Overhauled entire project config, added notifications, email templates, optimized stripe subscriptions, redis caching, and webdriver utilities

This commit is contained in:
Keannu Christian Bernasol 2024-05-10 23:15:29 +08:00
parent 7cbe8fd720
commit 99dfcef67b
84 changed files with 4300 additions and 867 deletions

View file

@ -0,0 +1,24 @@
from django.db import models
from django.utils.timezone import now
from config.settings import STRIPE_SECRET_KEY
import stripe
stripe.api_key = STRIPE_SECRET_KEY
class UserGroup(models.Model):
name = models.CharField(max_length=128, null=False)
owner = models.ForeignKey(
'accounts.CustomUser', on_delete=models.SET_NULL, null=True, related_name='usergroup_owner')
managers = models.ManyToManyField(
'accounts.CustomUser', related_name='usergroup_managers')
members = models.ManyToManyField(
'accounts.CustomUser', related_name='usergroup_members')
date_created = models.DateTimeField(default=now, editable=False)
# Derived from email of owner, may be used for billing
@property
def email(self):
return self.owner.email
def __str__(self):
return self.name