Add a sync_mailmaps management command
The command refreshes all the active mailmaps, and disables every mailmap that has recently been updated and marked as disabled, once. To do these actions as atomically as possible, we make sure to select all rows for update, and to defer all _date fields in the default queryset manager for UserMailmap objects to avoid resetting them to earlier values by mistake.
Showing
- requirements-test.txt 1 addition, 0 deletionsrequirements-test.txt
- swh/web/auth/management/__init__.py 0 additions, 0 deletionsswh/web/auth/management/__init__.py
- swh/web/auth/management/commands/__init__.py 0 additions, 0 deletionsswh/web/auth/management/commands/__init__.py
- swh/web/auth/management/commands/sync_mailmaps.py 118 additions, 0 deletionsswh/web/auth/management/commands/sync_mailmaps.py
- swh/web/auth/models.py 30 additions, 0 deletionsswh/web/auth/models.py
- swh/web/tests/auth/test_mailmap.py 243 additions, 0 deletionsswh/web/tests/auth/test_mailmap.py
Loading
Please register or sign in to comment