Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
thalia
concrexit
Commits
61d13ad6
Verified
Commit
61d13ad6
authored
Jan 20, 2019
by
Sébastiaan Versteeg
Browse files
Remove replace code for non-deletable items
parent
bdf47e1b
Changes
1
Hide whitespace changes
Inline
Side-by-side
website/members/management/commands/conscribosync.py
View file @
61d13ad6
...
...
@@ -76,6 +76,11 @@ class Command(BaseCommand):
code
=
code
,
))
replace_responses
=
api
.
multi_request
(
replace_commands
)
for
response
in
replace_responses
:
if
not
response
.
success
:
logger
.
debug
(
response
.
notifications
)
delete_commands
=
[]
for
website_id
,
code
in
current_relations
.
items
():
delete_commands
.
append
(
ApiCommand
(
...
...
@@ -89,41 +94,6 @@ class Command(BaseCommand):
for
response
in
delete_responses
:
if
not
response
.
success
:
logger
.
debug
(
response
.
notifications
)
website_id
=
delete_commands
[
response
.
request_sequence
].
data
.
get
(
'website_id'
)
code
=
delete_commands
[
response
.
request_sequence
].
data
.
get
(
'code'
)
member
=
Member
.
objects
.
get
(
pk
=
website_id
)
fields
=
{
'website_id'
:
member
.
pk
,
'voornaam'
:
member
.
first_name
,
'naam'
:
member
.
last_name
,
'einddatum_lidmaatschap'
:
date
(
member
.
latest_membership
.
until
,
'Y-m-d'
),
'e_mailadres'
:
''
,
'straatnaam'
:
''
,
'postcode'
:
''
,
'plaats'
:
''
,
'land'
:
''
,
'bankrekeningnummer'
:
{
'name'
:
''
,
'bic'
:
''
,
'iban'
:
''
,
},
}
replace_commands
.
append
(
ApiCommand
(
command
=
'ReplaceRelation'
,
entityType
=
'lid'
,
fields
=
fields
,
code
=
code
,
))
replace_responses
=
api
.
multi_request
(
replace_commands
)
for
response
in
replace_responses
:
if
not
response
.
success
:
logger
.
debug
(
response
.
notifications
)
except
HTTPError
as
e
:
logger
.
error
(
'HTTP error syncing relations to Conscribo'
,
e
)
except
ResultException
as
e
:
...
...
Write
Preview
Supports
Markdown
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