mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-19 02:49:21 +02:00
Add waffleswitch and hook it to email
This commit is contained in:
parent
ef4e758517
commit
6ad2546a40
6 changed files with 100 additions and 4 deletions
|
@ -15,8 +15,8 @@ from django.contrib.contenttypes.models import ContentType
|
|||
from django.urls import reverse
|
||||
from dateutil.relativedelta import relativedelta # type: ignore
|
||||
from epplibwrapper.errors import ErrorCode, RegistryError
|
||||
from waffle.admin import FlagAdmin
|
||||
from waffle.models import Sample, Switch
|
||||
from waffle.admin import FlagAdmin, SwitchAdmin
|
||||
from waffle.models import Sample
|
||||
from registrar.models import Contact, Domain, DomainRequest, DraftDomain, User, Website
|
||||
from registrar.utility.errors import FSMDomainRequestError, FSMErrorCodes
|
||||
from registrar.views.utility.mixins import OrderableFieldsMixin
|
||||
|
@ -2308,6 +2308,7 @@ class UserGroupAdmin(AuditedAdmin):
|
|||
|
||||
|
||||
class WaffleFlagAdmin(FlagAdmin):
|
||||
"""Custom admin implementation of django-waffle's Flag class"""
|
||||
class Meta:
|
||||
"""Contains meta information about this class"""
|
||||
|
||||
|
@ -2315,6 +2316,14 @@ class WaffleFlagAdmin(FlagAdmin):
|
|||
fields = "__all__"
|
||||
|
||||
|
||||
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)
|
||||
|
@ -2340,7 +2349,7 @@ admin.site.register(models.VerifiedByStaff, VerifiedByStaffAdmin)
|
|||
|
||||
# Register our custom waffle implementations
|
||||
admin.site.register(models.WaffleFlag, WaffleFlagAdmin)
|
||||
admin.site.register(models.WaffleSwitch, WaffleSwitchAdmin)
|
||||
|
||||
# Unregister Sample and Switch from the waffle library
|
||||
# Unregister Sample from the waffle library
|
||||
admin.site.unregister(Sample)
|
||||
admin.site.unregister(Switch)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue