mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-15 07:12:16 +00:00
Added the ability to mark a blacklist item's source
This commit is contained in:
@@ -51,3 +51,11 @@ BLACKLIST_TYPE_CHOICES = (
|
|||||||
(BLACKLIST_TYPE_EMAIL, 'Email Address'),
|
(BLACKLIST_TYPE_EMAIL, 'Email Address'),
|
||||||
(BLACKLIST_TYPE_AUTH, 'Auth Account'),
|
(BLACKLIST_TYPE_AUTH, 'Auth Account'),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
BLACKLIST_SOURCE_INTERNAL = 0
|
||||||
|
BLACKLIST_SOURCE_EXTERNAL = 1
|
||||||
|
|
||||||
|
BLACKLIST_SOURCE_CHOICES = (
|
||||||
|
(BLACKLIST_SOURCE_INTERNAL, 'Internal'),
|
||||||
|
(BLACKLIST_SOURCE_EXTERNAL, 'External'),
|
||||||
|
)
|
||||||
|
|||||||
@@ -131,6 +131,11 @@ class Blacklist(models.Model):
|
|||||||
expiry_date = models.DateTimeField(verbose_name="Expiry Date", blank=False, null=True,
|
expiry_date = models.DateTimeField(verbose_name="Expiry Date", blank=False, null=True,
|
||||||
help_text="Date to expire this entry")
|
help_text="Date to expire this entry")
|
||||||
|
|
||||||
|
source = models.IntegerField(choices=BLACKLIST_SOURCE_CHOICES,
|
||||||
|
verbose_name="Blacklist Source",
|
||||||
|
help_text="Source of the blacklisted item",
|
||||||
|
default=BLACKLIST_SOURCE_INTERNAL)
|
||||||
|
|
||||||
created_date = models.DateTimeField(auto_now_add=True, verbose_name="Created Date")
|
created_date = models.DateTimeField(auto_now_add=True, verbose_name="Created Date")
|
||||||
created_by = models.ForeignKey(User, blank=False, verbose_name="Created By")
|
created_by = models.ForeignKey(User, blank=False, verbose_name="Created By")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user