I broke the import script
This commit is contained in:
parent
525f091b0c
commit
2a113d22b9
|
@ -94,7 +94,7 @@ class Command(ImportCommand):
|
||||||
# clean pseudo (normalized pseudo must be unique and not empty)
|
# clean pseudo (normalized pseudo must be unique and not empty)
|
||||||
if not pseudo_norm or pseudo_norm in ALIAS_SET:
|
if not pseudo_norm or pseudo_norm in ALIAS_SET:
|
||||||
pseudo = pseudo + str(row["idbde"])
|
pseudo = pseudo + str(row["idbde"])
|
||||||
CHANGED_USERNAMES.append((pk_note, row[pseudo], pseudo))
|
CHANGED_USERNAMES.append((pk_note, row["idbde"], pseudo))
|
||||||
else:
|
else:
|
||||||
ALIAS_SET.add(pseudo_norm)
|
ALIAS_SET.add(pseudo_norm)
|
||||||
# clean date
|
# clean date
|
||||||
|
@ -138,7 +138,7 @@ class Command(ImportCommand):
|
||||||
"registration_valid": True,
|
"registration_valid": True,
|
||||||
"email_confirmed": True,
|
"email_confirmed": True,
|
||||||
"promotion": MAP_IDBDE_PROMOTION[row["idbde"]]["promo"],
|
"promotion": MAP_IDBDE_PROMOTION[row["idbde"]]["promo"],
|
||||||
"report_frequency": row["report_period"],
|
"report_frequency": max(row["report_period"], 0),
|
||||||
"last_report": make_aware(row["previous_report_date"]),
|
"last_report": make_aware(row["previous_report_date"]),
|
||||||
}
|
}
|
||||||
note_dict["created_at"] = make_aware(MAP_IDBDE_PROMOTION[row["idbde"]]["created_at"])
|
note_dict["created_at"] = make_aware(MAP_IDBDE_PROMOTION[row["idbde"]]["created_at"])
|
||||||
|
@ -248,7 +248,7 @@ class Command(ImportCommand):
|
||||||
json.dump(MAP_IDBDE, fp, sort_keys=True, indent=2)
|
json.dump(MAP_IDBDE, fp, sort_keys=True, indent=2)
|
||||||
|
|
||||||
for pk_user, old_username, new_username in CHANGED_USERNAMES:
|
for pk_user, old_username, new_username in CHANGED_USERNAMES:
|
||||||
user = User.objects.get(pk_user)
|
user = User.objects.get(pk=pk_user)
|
||||||
mail_text = render_to_string("scripts/unsupported_username.txt", dict(
|
mail_text = render_to_string("scripts/unsupported_username.txt", dict(
|
||||||
user=user,
|
user=user,
|
||||||
old_username=old_username,
|
old_username=old_username,
|
||||||
|
@ -257,7 +257,7 @@ class Command(ImportCommand):
|
||||||
user.email_user("Transition à la Note Kfet 2020 : pseudo non supporté", mail_text)
|
user.email_user("Transition à la Note Kfet 2020 : pseudo non supporté", mail_text)
|
||||||
|
|
||||||
for pk_user, aliases_list in CHANGED_USERNAMES:
|
for pk_user, aliases_list in CHANGED_USERNAMES:
|
||||||
user = User.objects.get(pk_user)
|
user = User.objects.get(pk=pk_user)
|
||||||
mail_text = render_to_string("scripts/deleted_aliases.txt", dict(
|
mail_text = render_to_string("scripts/deleted_aliases.txt", dict(
|
||||||
user=user,
|
user=user,
|
||||||
aliases_list=aliases_list,
|
aliases_list=aliases_list,
|
||||||
|
|
Loading…
Reference in New Issue