Add modified object title to notifications of end user edits
authorMagnus Hagander <magnus@hagander.net>
Mon, 23 Nov 2020 16:16:55 +0000 (17:16 +0100)
committerMagnus Hagander <magnus@hagander.net>
Mon, 23 Nov 2020 16:16:55 +0000 (17:16 +0100)
Commit c2d58d6 only added the title of the object to notifications when
an object were modified by a moderator/admin, not by the end user. Fix
that to make it consistent.

pgweb/util/helpers.py

index f67dbd90b7d1afab7242ed5e26396ecc491e7f1c..2fa0372275710e92418f9ae3843dbe857655a083 100644 (file)
@@ -105,7 +105,7 @@ def simple_form(instancetype, itemid, request, formclass, formtemplate='base/for
                         notify.write("{}\n".format(str(form.cleaned_data[f])))
                     notify.write("\n")
             else:
-                subj = '{0} id {1} has been modified'.format(instance._meta.verbose_name, instance.id)
+                subj = '{0} id {1} ({2}) has been modified'.format(instance._meta.verbose_name, instance.id, str(instance))
 
                 for fn in form.changed_data:
                     if not hasattr(instance, fn):