2
0
Fork 0

Replace '$token' with login token in bulk messages

This commit is contained in:
Luca 2022-05-16 21:38:56 +02:00
parent 920de57f2b
commit 964de92b9d
1 changed files with 7 additions and 1 deletions

View File

@ -87,7 +87,13 @@ def bulk_message(request):
try: try:
Message.objects.bulk_create( 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) for helper in Helper.objects.filter(number_validated=True)
) )
) )