Conditions | 2 |
Total Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | from djoser import utils |
||
5 | def activation_email(request, user, **kwargs): |
||
6 | """ |
||
7 | Side effect of updating is_active field to False |
||
8 | """ |
||
9 | user_email = utils.get_user_email(user) |
||
10 | assert user_email is not None |
||
11 | to = [user_email] |
||
12 | context = {'user': user} |
||
13 | context.update(kwargs) |
||
14 | settings.EMAIL['activation'](request, context).send(to) |
||
15 | |||
16 | user.is_active = False |
||
17 | user.save(update_fields=['is_active']) |
||
18 | |||
27 |
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.