Commit 823dd008 authored by Jérome Perrin's avatar Jérome Perrin

base: only consider open assignment to initialize preferences

parent 0236f68b
Pipeline #38240 running with stage
in 0 seconds
......@@ -19,6 +19,8 @@ preference.setTitle(translateString('Preference for ${name}',
mapping=dict(name=context.getTitle())))
for assignment in context.contentValues(portal_type='Assignment'):
if assignment.getValidationState() != 'open':
continue
group = assignment.getGroup(base=True)
if group:
preference.setPreferredSectionCategory(group)
......
......@@ -1309,6 +1309,12 @@ class TestERP5Base(ERP5TypeTestCase):
site='distibution/tokyo')
self.assertNotEqual(None, assignment.getGroupValue())
assignment.open()
# unrelated assignment that should be ignored
person.newContent(
portal_type='Assignment',
group='nexedi/rentalinux',
site='distibution/new_york',
)
login = person.newContent(
portal_type="ERP5 Login",
reference="user_login",
......
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