Replace '$token' with login token in bulk messages

pull/1/head
Luca 3 years ago
parent 920de57f2b
commit 964de92b9d

@ -87,7 +87,13 @@ def bulk_message(request):
try:
Message.objects.bulk_create(
(
Message(text=form.cleaned_data["message"], to=helper)
Message(
text=form.cleaned_data["message"].replace(
"$token",
f"https://kontakt.rocks{helper.logintoken_set.first().get_absolute_url()}",
),
to=helper,
)
for helper in Helper.objects.filter(number_validated=True)
)
)

Loading…
Cancel
Save