Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
third-party
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cooperatic-foodcoops
third-party
Commits
9bc66657
Commit
9bc66657
authored
Nov 18, 2021
by
François
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#1694 Manage without birthdate associated people
parent
e1bc64f5
Pipeline
#1460
passed with stage
in 1 minute 28 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
models.py
members/models.py
+10
-4
No files found.
members/models.py
View file @
9bc66657
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment