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).
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 theMessageSerializer
fields are read-only so users don't inadvertently change a message after-the-fact.Also changed the existing
message_view
fn to be calledtext_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.