Commit Graph

19 Commits

Author SHA1 Message Date
5ffe6c389c Re-work moderation of submitted items
This includes a number of new features:

* Move some moderation functionality into shared places, so we don't
  keep re-inventing the wheel.
* Implement three-state moderation, where the submitter can edit their
  item and then explicitly say "i'm done, please moderate this now".
  This is currently only implemented for News, but done in a reusable
  way.
* Move moderation workflow to it's own set of URLs instead of
  overloading it on the general admin interface. Admin interface remains
  for editing things, but these are now separated out into separate
  things.
* Do proper stylesheet clearing for moderation of markdown fields, using
  a dynamic sandboxed iframe, so it's not ruined by the /admin/ css.
* Move moderation email notification into dedicated moderation code,
  thereby simplifying the admin subclassing we did which was in some
  places quite fragile.
* Reset date of news postings to the date of their approval, when
  approved. This avoids some annoying ordering issues.
2020-09-10 14:52:41 +02:00
a90cbd217e Set headers for no auto response on most emails
Most of our auto-generated emails should not ask for auto replies (like
out of office messages or in particular, "held for moderation" notices
from our own list server), so set this header by default, and also the
header indicating if it's an auto submitted/auto replied message.

Specifically allow auto replies on moderation notices, since that's a
case where it might be really interesting for the moderator to see for
example an out of office message. At least for now that seems like a
good idea.
2020-04-20 10:49:33 +02:00
9c69eed6e9 Fix spelling error 2020-04-20 10:49:33 +02:00
00ab822ea8 Fix deprecated comparison structs 2019-01-17 21:19:57 +01:00
0883ac6423 Fix whitespace and indentation, per pep8 2019-01-17 20:47:43 +01:00
87237f6536 Tabs, meet your new overlords: spaces
In a quest to reach pep8, use spaces to indent rather than tabs.
2019-01-17 15:35:39 +01:00
48146f2ae2 Ensure UK spelling for language across pgweb. 2018-04-15 14:09:06 -04:00
597824f09f Fix admin base for non-notification models 2018-01-22 12:28:14 +01:00
8b2d0fe993 Remove support for "remove after notify" on moderation
This broke when we had ManyToMany relations on a record. We didn't use
to have that, but with tags for news we now do. With this change, the
"reject with a notice" becomes a two step operation, the first one
adding the notification and the second one doing the removal. That'll
have to do for now, and at some point in the future we may create a
completely separate (non /admin/) workflow for moderation and fix it
that way.
2017-12-20 13:58:17 +01:00
350b936e58 Prefix cross-application imports with pgweb
As required by the new project layout.
2016-05-14 19:49:12 +02:00
8f0b7e6b50 Switch email sending go through a queue table in the database
Import the code from the PostgreSQL Europe website to handle this, since it's
well proven by now.

Any points that send email now just write them to the database using the
functions in queuedmail.util. This means we can now submit notification
emails and such things within transactions and have them properly roll bcak
if something goes wrong (so no more incorrect notifications when there is
a database error).

These emails are picked up by a cronjob that runs frequently (typically
once per minute or once every 2 minutes) that submits them to the local
mailserver. By doing it out of line, this gives us a much better way of
dealing with cases where mail delivery is really slow.

The submission from the cronjob is now done with smtp to localhost instead
of opening a pipe to the sendmail command - though this should have no
major effects on anything.

This also removes the setting SUPPRESS_NOTIFICATIONS, as no notifications
are actually ever sent unless the cronjob is run. On development systems
they will just go into the queuedmail table, and can be deleted from there.
2014-01-11 12:33:06 +01:00
c7685ca70a Fix parameters to inherited change_view function
Must be the same as in in the inherited-from class, or we ended up
passing a python dict as a string, and render the contents of it as
the "action" attribute on the form.
2013-06-16 16:35:21 +02:00
24ff36eb28 Make sure new_notification is actually in POST before we try to use it 2012-07-06 10:06:30 +02:00
05a856e841 Override builting delete_selected action with one that does notifies
This should fix the problem where notifications weren't sent for objects
being deleted through the "mass deletion" function in the list of objects.

Closes #121
2012-06-26 15:14:52 +02:00
3c5cf33c37 Add missing comment 2012-06-26 14:50:30 +02:00
1aa15247fd Support PgAdmin classes that don't have markdown fields 2012-06-26 14:34:26 +02:00
7855d1b06c Implement ability for moderators to send notices to organisations
Notices entered will be sent to the organisations email address - so there
needs to be one (if not, the notification field doesn't show up).

Notifications also go in the database, and show up on each object so you
can see the previous history of it, and get emailed to the slaves list.

Finally, it's possible to reject-with-notification, in which case the
notification is sent off to the user and after that the object is deleted.
The notification history stays in the database, but is not linked anywhere
(but can be viewed from the admin interface on that model directly).
Unfortunately, this seems to cause double notifications to the slaves list,
but we'll have to live with that for now.

Closes #137
2012-06-26 14:34:26 +02:00
1118572dbd Rename MarkdownPreviewAdmin to PgwebAdmin
This is in preparation for adding more functionality to it...
2012-06-26 12:43:31 +02:00
e808d4cdb3 Add (working) previewing of markdown fields in the admin interface. 2009-09-18 10:18:41 +02:00