Improve moderation messages somewhat

Change the subject to use the title of the object instead of the id, and
include a link to the moderation page. There's surely more to be done,
but this is a decent start.
This commit is contained in:
Magnus Hagander
2020-09-18 11:13:36 +02:00
parent eec44cb08e
commit d7d5b105d1
2 changed files with 6 additions and 5 deletions

View File

@ -312,12 +312,13 @@ def _submitted_item_submit(request, objtype, model, obj):
send_simple_mail(settings.NOTIFICATION_FROM,
settings.NOTIFICATION_EMAIL,
"{} {} submitted".format(obj._meta.verbose_name.capitalize(), obj.id),
"{} {} with title '{}' submitted for moderation by {}".format(
"{} '{}' submitted for moderation".format(obj._meta.verbose_name.capitalize(), obj.title),
"{} {} with title '{}' submitted for moderation by {}\n\nModerate at: {}\n".format(
obj._meta.verbose_name.capitalize(),
obj.id,
obj.title,
request.user.username
request.user.username,
'{}/admin/_moderate/{}/{}/'.format(settings.SITE_ROOT, obj._meta.model_name, obj.pk),
),
)
return HttpResponseRedirect("/account/edit/{}/".format(objtype))
@ -348,7 +349,7 @@ def _submitted_item_withdraw(request, objtype, model, obj):
send_simple_mail(
settings.NOTIFICATION_FROM,
settings.NOTIFICATION_EMAIL,
"{} {} withdrawn from moderation".format(model._meta.verbose_name.capitalize(), obj.id),
"{} '{}' withdrawn from moderation".format(model._meta.verbose_name.capitalize(), obj.title),
"{} {} with title {} withdrawn from moderation by {}".format(
model._meta.verbose_name.capitalize(),
obj.id,

View File

@ -378,7 +378,7 @@ def _send_moderation_message(request, obj, message, notice, what):
send_simple_mail(settings.NOTIFICATION_FROM,
settings.NOTIFICATION_EMAIL,
"{} {} by {}".format(obj._meta.verbose_name.capitalize(), what, modname),
"{} '{}' {} by {}".format(obj._meta.verbose_name.capitalize(), obj.title, what, modname),
admmsg)