Track multiple email addresses for an organisation
authorMagnus Hagander <magnus@hagander.net>
Thu, 10 Sep 2020 12:52:41 +0000 (14:52 +0200)
committerMagnus Hagander <magnus@hagander.net>
Thu, 10 Sep 2020 12:52:41 +0000 (14:52 +0200)
commit7a9e5320914838379f7c626d21c826984a148ece
tree39daf5ca7d3671858d7577df09c1fa7ee59bbe28
parent3ab07fa069aec96c7b2dd8290c50ca7f01b27426
Track multiple email addresses for an organisation

This allows organisation managers to add more than one email address to
an organisation, and use this for sending news from. Sending news is the
only thing that the email field is used for at this point. Adding an
email will trigger a validation email sent to the address with a token
to confirm it, so that we can actually trust the emails.

Remove the previous registered emails on organisations. These addresses
were never validated and thus cannot really be trusted, so it's better
to remove them cleanly than to migrate them into the new system and be
uncertain.

Finally, in passing, remove the phone field on organisations. We've
never used that for anything and there's not really any point in
collecting the data.
12 files changed:
pgweb/account/urls.py
pgweb/account/views.py
pgweb/core/forms.py
pgweb/core/management/commands/cleanup_old_records.py
pgweb/core/migrations/0004_org_emails.py [new file with mode: 0644]
pgweb/core/models.py
pgweb/news/admin.py
pgweb/news/forms.py
pgweb/news/migrations/0006_sending_email.py [new file with mode: 0644]
pgweb/news/models.py
pgweb/news/util.py
templates/core/org_add_email.txt [new file with mode: 0644]