Implement notification rules and settings
This commit is contained in:
@@ -122,3 +122,22 @@ class Perms(models.Model):
|
||||
("index_restricted", "Can use the restricted index"),
|
||||
("restricted_sources", "Can access restricted sources"),
|
||||
)
|
||||
|
||||
|
||||
class NotificationRule(models.Model):
|
||||
user = models.ForeignKey(User, on_delete=models.CASCADE)
|
||||
name = models.CharField(max_length=255)
|
||||
enabled = models.BooleanField(default=True)
|
||||
data = models.TextField()
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.user} - {self.rule}"
|
||||
|
||||
|
||||
class NotificationSettings(models.Model):
|
||||
user = models.OneToOneField(User, on_delete=models.CASCADE)
|
||||
ntfy_topic = models.CharField(max_length=255, null=True, blank=True)
|
||||
ntfy_url = models.CharField(max_length=255, null=True, blank=True)
|
||||
|
||||
def __str__(self):
|
||||
return f"Notification settings for {self.user}"
|
||||
|
||||
Reference in New Issue
Block a user