Commit 9bc66657 by François

#1694 Manage without birthdate associated people

parent e1bc64f5
Pipeline #1460 passed with stage
in 1 minute 28 seconds
......@@ -118,19 +118,25 @@ class CagetteMember(models.Model):
fields = ['name', 'email', 'birthdate', 'create_date', 'cooperative_state', 'is_associated_people']
res = api.search_read('res.partner', cond, fields)
if (res and len(res) >= 1):
coop_id = None
for item in res:
coop = item
if item["birthdate"] is not False:
coop_birthdate = item['birthdate']
coop_state = item['cooperative_state']
if item["is_associated_people"] == True:
break
coop_id = item['id']
y, m, d = coop['birthdate'].split('-')
y, m, d = coop_birthdate.split('-')
password = password.replace('/', '')
if (password == d + m + y):
data['id'] = coop['id']
if coop_id is None:
coop_id = coop['id']
data['id'] = coop_id
auth_token_seed = fp + coop['create_date']
data['auth_token'] = hashlib.sha256(auth_token_seed.encode('utf-8')).hexdigest()
data['token'] = hashlib.sha256(coop['create_date'].encode('utf-8')).hexdigest()
data['coop_state'] = coop['cooperative_state']
data['coop_state'] = coop_state
if not ('auth_token' in data):
data['failure'] = True
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment