astrosat / django-astrosat-users

Common backend library for Astrosat projects' user management
GNU General Public License v3.0
2 stars 0 forks source link

Messages #154

Closed allynt closed 3 years ago

allynt commented 3 years ago

Added a Message class to record emails sent to users in the db. Provided the standard model/admin/serializer/view code. Made the API part of the "users" namespace: /api/users/<user_id>/messages/ but did not include messages in the normal user serialization; They must be accessed separately. Also, ensured that most of the MessageSerializer fields are read-only so users don't inadvertently change a message after-the-fact.

Also changed the existing message_view fn to be called text_view; it is used to display text by projects that use django-astrosat-users via normal Django Forms/Templates instead of via DRF APIs.

Also fixed the "example" app to use an appropriate DEFAULT_AUTO_FIELD (so it doesn't generate spurious migrations).

Also some linting.