| Conditions | 7 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | import uuid |
||
| 12 | def assign_role(backend, user, response, *args, **kwargs): |
||
| 13 | ''' |
||
| 14 | Part of the Python Social Auth Pipeline. |
||
| 15 | Checks if the created demo user should be pushed into some group. |
||
| 16 | ''' |
||
| 17 | if backend.name is 'passthrough' and settings.DEMO is True and 'role' in kwargs['request'].session[passthrough.SESSION_VAR]: |
||
| 18 | role = kwargs['request'].session[passthrough.SESSION_VAR]['role'] |
||
| 19 | if role == 'tutor': |
||
| 20 | make_tutor(user) |
||
| 21 | if role == 'admin': |
||
| 22 | make_admin(user) |
||
| 23 | if role == 'owner': |
||
| 24 | make_owner(user) |
||
| 25 | |||
| 38 |