Save the list of changed usernames and lost aliases
This commit is contained in:
parent
7479671b3f
commit
69c5c3bb36
|
@ -246,20 +246,7 @@ class Command(ImportCommand):
|
||||||
filename = kwargs["save"]
|
filename = kwargs["save"]
|
||||||
with open(filename, 'w') as fp:
|
with open(filename, 'w') as fp:
|
||||||
json.dump(MAP_IDBDE, fp, sort_keys=True, indent=2)
|
json.dump(MAP_IDBDE, fp, sort_keys=True, indent=2)
|
||||||
|
with open(filename + ".changed-usernames", 'w') as fp:
|
||||||
for pk_user, old_username, new_username in CHANGED_USERNAMES:
|
json.dump(CHANGED_USERNAMES, fp, sort_keys=True, indent=2)
|
||||||
user = User.objects.get(pk=pk_user)
|
with open(filename + ".removed-aliases", 'w') as fp:
|
||||||
mail_text = render_to_string("scripts/unsupported_username.txt", dict(
|
json.dump(LOST_ALIASES, fp, sort_keys=True, indent=2)
|
||||||
user=user,
|
|
||||||
old_username=old_username,
|
|
||||||
new_username=new_username,
|
|
||||||
))
|
|
||||||
user.email_user("Transition à la Note Kfet 2020 : pseudo non supporté", mail_text)
|
|
||||||
|
|
||||||
for pk_user, aliases_list in CHANGED_USERNAMES:
|
|
||||||
user = User.objects.get(pk=pk_user)
|
|
||||||
mail_text = render_to_string("scripts/deleted_aliases.txt", dict(
|
|
||||||
user=user,
|
|
||||||
aliases_list=aliases_list,
|
|
||||||
))
|
|
||||||
user.email_user("Transition à la Note Kfet 2020 : suppression d'alias", mail_text)
|
|
||||||
|
|
Loading…
Reference in New Issue