Open oalamoudi opened 4 years ago
Few extra things to look for
The API_Views should be renamed to view. The only views there are for APIs. Views should be restricting access to only those who are subscribers.
the plans should be stored on a separate model not on the same models as memberships.
Use drf guardian to give permission to only one object (rdf guardian is an extra requirement don't bother if you do not know how to use it) + admin user can modify all objects. Note: if you don't know how to use guardian please only allow users to change their own subscription and create views that can only be used by the admin or super users to add, update, suspend, or retrieve subscription information.
create a record of all operations done ( What happened , when it happened, who did it).
All API must be accessed by Authenticated users
First Upload your work to the private repo, I already gave you an access.
User = get_user_model()
MEMBERSHIPCHOICES = ( (('Enterprise'), 'ent'), (('Professional'), 'pro'), (('Free'), 'free') )
in a field always use Verbose_name like this
Always add Verbose_name and verbose_name_plural to the model meta
class Membership(models.Model): ... class Meta: Verbosename = ('Membership') verbose_nameplural = ('Memberships')