equal
deleted
inserted
replaced
21 '"Sverre Rabbelier" <sverre@rabbelier.nl>', |
21 '"Sverre Rabbelier" <sverre@rabbelier.nl>', |
22 '"Lennard de Rijk" <ljvderijk@gmail.com>', |
22 '"Lennard de Rijk" <ljvderijk@gmail.com>', |
23 ] |
23 ] |
24 |
24 |
25 |
25 |
|
26 from soc.cache import sidebar |
26 from soc.logic.models import base |
27 from soc.logic.models import base |
27 |
28 |
28 import soc.models.role |
29 import soc.models.role |
29 |
30 |
30 |
31 |
60 |
61 |
61 group = group_logic.getForFields(fields, unique=True) |
62 group = group_logic.getForFields(fields, unique=True) |
62 |
63 |
63 return group |
64 return group |
64 |
65 |
|
66 def _updateField(self, entity, name, value): |
|
67 """Special logic for role. If state changes to active we flush the sidebar. |
|
68 """ |
|
69 |
|
70 if (name == 'state') and (entity.state != value) and value == 'active': |
|
71 # in case the state of the role changes to active we flush the sidebar |
|
72 # cache. Other changes will be visible after the retention time expires. |
|
73 sidebar.flush(entity.user.account) |
|
74 |
|
75 return True |
|
76 |
65 |
77 |
66 logic = Logic() |
78 logic = Logic() |