mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-19 19:09:22 +02:00
Linting
This commit is contained in:
parent
6342f63596
commit
5c1e41bb55
3 changed files with 6 additions and 3 deletions
|
@ -2309,6 +2309,7 @@ class UserGroupAdmin(AuditedAdmin):
|
|||
|
||||
class WaffleFlagAdmin(FlagAdmin):
|
||||
"""Custom admin implementation of django-waffle's Flag class"""
|
||||
|
||||
class Meta:
|
||||
"""Contains meta information about this class"""
|
||||
|
||||
|
@ -2318,12 +2319,14 @@ class WaffleFlagAdmin(FlagAdmin):
|
|||
|
||||
class WaffleSwitchAdmin(SwitchAdmin):
|
||||
"""Custom admin implementation of django-waffle's Switch class"""
|
||||
|
||||
class Meta:
|
||||
"""Contains meta information about this class"""
|
||||
|
||||
model = models.WaffleSwitch
|
||||
fields = "__all__"
|
||||
|
||||
|
||||
admin.site.unregister(LogEntry) # Unregister the default registration
|
||||
|
||||
admin.site.register(LogEntry, CustomLogEntryAdmin)
|
||||
|
|
|
@ -9,7 +9,6 @@ from email.mime.application import MIMEApplication
|
|||
from email.mime.multipart import MIMEMultipart
|
||||
from email.mime.text import MIMEText
|
||||
from waffle import switch_is_active
|
||||
from django.conf import settings
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -38,7 +37,8 @@ def send_templated_email(
|
|||
Raises EmailSendingError if SES client could not be accessed
|
||||
"""
|
||||
if switch_is_active("disable_email_sending") and not settings.IS_PRODUCTION:
|
||||
raise EmailSendingError("Could not send email. Email sending is disabled due to switch 'disable_email_sending'.")
|
||||
message = "Could not send email. Email sending is disabled due to switch 'disable_email_sending'."
|
||||
raise EmailSendingError(message)
|
||||
|
||||
template = get_template(template_name)
|
||||
email_body = template.render(context=context)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue