| Conditions | 2 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | from djoser import utils |
||
| 5 | def activation_email(request, context): |
||
| 6 | """ |
||
| 7 | Side effect of updating is_active field to False |
||
| 8 | """ |
||
| 9 | utils.validate_context_user_for_email(context) |
||
| 10 | user = context['user'] |
||
| 11 | |||
| 12 | user_email = utils.get_user_email(user) |
||
| 13 | assert user_email is not None |
||
| 14 | to = [user_email] |
||
| 15 | settings.EMAIL.activation(request, context).send(to) |
||
| 16 | |||
| 17 | user.is_active = False |
||
| 18 | user.save(update_fields=['is_active']) |
||
| 19 | |||
| 39 |
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.