mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-16 09:37:03 +02:00
Lint
This commit is contained in:
parent
4b82f5e131
commit
91d1b9c1cc
10 changed files with 218 additions and 155 deletions
|
@ -16,19 +16,17 @@ class User(AbstractUser):
|
|||
A custom user model that performs identically to the default user model
|
||||
but can be customized later.
|
||||
"""
|
||||
|
||||
|
||||
# #### Constants for choice fields ####
|
||||
INELIGIBLE = 'ineligible'
|
||||
STATUS_CHOICES = (
|
||||
(INELIGIBLE, INELIGIBLE),
|
||||
)
|
||||
|
||||
INELIGIBLE = "ineligible"
|
||||
STATUS_CHOICES = ((INELIGIBLE, INELIGIBLE),)
|
||||
|
||||
status = models.CharField(
|
||||
max_length=10,
|
||||
choices=STATUS_CHOICES,
|
||||
default=None, # Set the default value to None
|
||||
null=True, # Allow the field to be null
|
||||
blank=True, # Allow the field to be blank
|
||||
null=True, # Allow the field to be null
|
||||
blank=True, # Allow the field to be blank
|
||||
)
|
||||
|
||||
domains = models.ManyToManyField(
|
||||
|
@ -52,15 +50,15 @@ class User(AbstractUser):
|
|||
return self.email
|
||||
else:
|
||||
return self.username
|
||||
|
||||
|
||||
def block_user(self):
|
||||
self.status = "ineligible"
|
||||
self.save()
|
||||
|
||||
|
||||
def unblock_user(self):
|
||||
self.status = None
|
||||
self.save()
|
||||
|
||||
|
||||
def is_blocked(self):
|
||||
if self.status == "ineligible":
|
||||
return True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue