Commit 6b74f6bd authored by Rafael Monnerat's avatar Rafael Monnerat

erp5_credential: Don"t set start date on assignments if stop date is None

parent 7829bafe
...@@ -23,8 +23,11 @@ assignment_duration = context.portal_preferences.getPreferredCredentialAssignmen ...@@ -23,8 +23,11 @@ assignment_duration = context.portal_preferences.getPreferredCredentialAssignmen
today = DateTime() today = DateTime()
if assignment_duration < 0: if assignment_duration < 0:
delay = None delay = None
start_date = None
else: else:
delay = today+assignment_duration delay = today+assignment_duration
start_date = today - 1
current_assignment_list = {} current_assignment_list = {}
for assignment in open_assignment_list: for assignment in open_assignment_list:
...@@ -57,7 +60,7 @@ for role in context.getRoleList(): ...@@ -57,7 +60,7 @@ for role in context.getRoleList():
function = context.getFunctionList(), function = context.getFunctionList(),
group = context.getGroupList(), group = context.getGroupList(),
destination = organisation_url, destination = organisation_url,
start_date = today - 1, start_date = start_date,
stop_date = delay) stop_date = delay)
assignment.open() assignment.open()
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