mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-28 13:36:30 +02:00
skeleton pt 2
This commit is contained in:
parent
fbfab28f3b
commit
42dec38b22
7 changed files with 18 additions and 10 deletions
|
@ -3169,9 +3169,9 @@ class SuborganizationAdmin(ListHeaderAdmin, ImportExportModelAdmin):
|
||||||
extra_context = {"domain_requests": domain_requests, "domains": domains}
|
extra_context = {"domain_requests": domain_requests, "domains": domains}
|
||||||
return super().change_view(request, object_id, form_url, extra_context)
|
return super().change_view(request, object_id, form_url, extra_context)
|
||||||
|
|
||||||
class AllowedEmailsAdmin(ListHeaderAdmin):
|
class AllowedEmailAdmin(ListHeaderAdmin):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = models.AllowedEmails
|
model = models.AllowedEmail
|
||||||
|
|
||||||
list_display = ["email"]
|
list_display = ["email"]
|
||||||
search_fields = ["email"]
|
search_fields = ["email"]
|
||||||
|
@ -3205,7 +3205,7 @@ admin.site.register(models.Portfolio, PortfolioAdmin)
|
||||||
admin.site.register(models.DomainGroup, DomainGroupAdmin)
|
admin.site.register(models.DomainGroup, DomainGroupAdmin)
|
||||||
admin.site.register(models.Suborganization, SuborganizationAdmin)
|
admin.site.register(models.Suborganization, SuborganizationAdmin)
|
||||||
admin.site.register(models.SeniorOfficial, SeniorOfficialAdmin)
|
admin.site.register(models.SeniorOfficial, SeniorOfficialAdmin)
|
||||||
admin.site.register(models.AllowedEmails, AllowedEmailsAdmin)
|
admin.site.register(models.AllowedEmail, AllowedEmailAdmin)
|
||||||
|
|
||||||
# Register our custom waffle implementations
|
# Register our custom waffle implementations
|
||||||
admin.site.register(models.WaffleFlag, WaffleFlagAdmin)
|
admin.site.register(models.WaffleFlag, WaffleFlagAdmin)
|
||||||
|
|
|
@ -11,7 +11,7 @@ class Migration(migrations.Migration):
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name="AllowedEmails",
|
name="AllowedEmail",
|
||||||
fields=[
|
fields=[
|
||||||
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
|
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
|
||||||
("created_at", models.DateTimeField(auto_now_add=True)),
|
("created_at", models.DateTimeField(auto_now_add=True)),
|
|
@ -25,7 +25,7 @@ def create_groups(apps, schema_editor) -> Any:
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
dependencies = [
|
dependencies = [
|
||||||
("registrar", "0119_allowedemails"),
|
("registrar", "0119_allowedemail"),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
|
|
@ -21,7 +21,7 @@ from .portfolio import Portfolio
|
||||||
from .domain_group import DomainGroup
|
from .domain_group import DomainGroup
|
||||||
from .suborganization import Suborganization
|
from .suborganization import Suborganization
|
||||||
from .senior_official import SeniorOfficial
|
from .senior_official import SeniorOfficial
|
||||||
from .allowed_emails import AllowedEmails
|
from .allowed_email import AllowedEmail
|
||||||
|
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
|
@ -47,7 +47,7 @@ __all__ = [
|
||||||
"DomainGroup",
|
"DomainGroup",
|
||||||
"Suborganization",
|
"Suborganization",
|
||||||
"SeniorOfficial",
|
"SeniorOfficial",
|
||||||
"AllowedEmails",
|
"AllowedEmail",
|
||||||
]
|
]
|
||||||
|
|
||||||
auditlog.register(Contact)
|
auditlog.register(Contact)
|
||||||
|
@ -72,4 +72,4 @@ auditlog.register(Portfolio)
|
||||||
auditlog.register(DomainGroup)
|
auditlog.register(DomainGroup)
|
||||||
auditlog.register(Suborganization)
|
auditlog.register(Suborganization)
|
||||||
auditlog.register(SeniorOfficial)
|
auditlog.register(SeniorOfficial)
|
||||||
auditlog.register(AllowedEmails)
|
auditlog.register(AllowedEmail)
|
||||||
|
|
|
@ -3,9 +3,9 @@ from django.db import models
|
||||||
from .utility.time_stamped_model import TimeStampedModel
|
from .utility.time_stamped_model import TimeStampedModel
|
||||||
|
|
||||||
|
|
||||||
class AllowedEmails(TimeStampedModel):
|
class AllowedEmail(TimeStampedModel):
|
||||||
"""
|
"""
|
||||||
AllowedEmails is a whitelist for email addresses that we can send to
|
AllowedEmail is a whitelist for email addresses that we can send to
|
||||||
in non-production environments.
|
in non-production environments.
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -32,6 +32,8 @@
|
||||||
{% include "django/admin/includes/descriptions/website_description.html" %}
|
{% include "django/admin/includes/descriptions/website_description.html" %}
|
||||||
{% elif opts.model_name == 'portfolioinvitation' %}
|
{% elif opts.model_name == 'portfolioinvitation' %}
|
||||||
{% include "django/admin/includes/descriptions/portfolio_invitation_description.html" %}
|
{% include "django/admin/includes/descriptions/portfolio_invitation_description.html" %}
|
||||||
|
{% elif opts.model_name == 'allowedemail' %}
|
||||||
|
{% include "django/admin/includes/descriptions/allowed_email_description.html" %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<p>This table does not have a description yet.</p>
|
<p>This table does not have a description yet.</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
<p>This table is an email whitelist for <strong>non-production</strong> environments.</p>
|
||||||
|
<p>
|
||||||
|
If an email is sent out and the email does not exist within this table (or is not a subset of it),
|
||||||
|
then no email will be sent.
|
||||||
|
</p>
|
||||||
|
<p>If this table is populated in a production environment, no change will occur as it will simply be ignored.</p>
|
Loading…
Add table
Add a link
Reference in a new issue