Commit e23637e9 authored by Lucas Carvalho's avatar Lucas Carvalho

Make sure that the user can have assignment for shacache and other of shadir.

parent de1a71eb
...@@ -58,9 +58,21 @@ class ShaSecurityMixin(object): ...@@ -58,9 +58,21 @@ class ShaSecurityMixin(object):
reference=reference, reference=reference,
password=password) password=password)
self.stepTic() self.stepTic()
create = True
start_date = '10/10/2000'
stop_date = '10/10/2100'
group=self.group
for assignment in person.contentValues(portal_type="Assignment"):
if assignment.getStartDate() == start_date and \
assignment.getStopDate() == stop_date and \
assignment.getGroup() == self.group:
create = False
if create:
assignment = person.newContent(portal_type='Assignment') assignment = person.newContent(portal_type='Assignment')
assignment.edit(start_date='10/10/2000', assignment.edit(start_date=start_date,
stop_date='10/10/2100', stop_date=stop_date,
group=self.group) group=self.group)
assignment.open() assignment.open()
self.stepTic() self.stepTic()
......
18 19
\ No newline at end of file \ No newline at end of file
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