Add priority to notification rules

This commit is contained in:
2023-01-12 07:20:48 +00:00
parent e01aea7712
commit 0b840d227b
4 changed files with 30 additions and 1 deletions

View File

@@ -15,6 +15,14 @@ except ImportError:
from yaml import Loader
logger = logging.getLogger(__name__)
PRIORITY_CHOICES = (
(1, "min"),
(2, "low"),
(3, "default"),
(4, "high"),
(5, "max"),
)
class Plan(models.Model):
name = models.CharField(max_length=255, unique=True)
@@ -137,6 +145,7 @@ class Perms(models.Model):
class NotificationRule(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE)
name = models.CharField(max_length=255)
priority = models.IntegerField(choices=PRIORITY_CHOICES, default=1)
enabled = models.BooleanField(default=True)
data = models.TextField()