mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-04 08:58:25 -04:00
Refactor to put user logic inside class
This commit is contained in:
@@ -462,6 +462,14 @@ class GovernmentDomain:
|
|||||||
self.agreement_signed
|
self.agreement_signed
|
||||||
) = self._get_details_of_domain()
|
) = self._get_details_of_domain()
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_user(cls, user):
|
||||||
|
return cls(user.email_address if user.is_authenticated else '')
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_current_user(cls):
|
||||||
|
return cls.from_user(current_user)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_matching_function(email_address_or_domain):
|
def get_matching_function(email_address_or_domain):
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user