mirror of
https://github.com/GSA/notifications-api.git
synced 2026-07-25 02:19:45 -04:00
Refactored tasks.py to split out letters_pdf tasks
- Added has_permission helper in models.py to check permission in service - Moved letters pdf tasks to separate file - Moved letters pdf tests to own file
This commit is contained in:
@@ -283,6 +283,9 @@ class Service(db.Model, Versioned):
|
||||
default_letter_contact = [x for x in self.letter_contacts if x.is_default]
|
||||
return default_letter_contact[0].contact_block if default_letter_contact else None
|
||||
|
||||
def has_permission(self, permission):
|
||||
return permission in [p.permission for p in self.permissions]
|
||||
|
||||
|
||||
class AnnualBilling(db.Model):
|
||||
__tablename__ = "annual_billing"
|
||||
|
||||
Reference in New Issue
Block a user