skeleton pt 2

This commit is contained in:
zandercymatics 2024-08-22 12:12:38 -06:00
parent fbfab28f3b
commit 42dec38b22
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
7 changed files with 18 additions and 10 deletions

View file

@ -3169,9 +3169,9 @@ class SuborganizationAdmin(ListHeaderAdmin, ImportExportModelAdmin):
extra_context = {"domain_requests": domain_requests, "domains": domains}
return super().change_view(request, object_id, form_url, extra_context)
class AllowedEmailsAdmin(ListHeaderAdmin):
class AllowedEmailAdmin(ListHeaderAdmin):
class Meta:
model = models.AllowedEmails
model = models.AllowedEmail
list_display = ["email"]
search_fields = ["email"]
@ -3205,7 +3205,7 @@ admin.site.register(models.Portfolio, PortfolioAdmin)
admin.site.register(models.DomainGroup, DomainGroupAdmin)
admin.site.register(models.Suborganization, SuborganizationAdmin)
admin.site.register(models.SeniorOfficial, SeniorOfficialAdmin)
admin.site.register(models.AllowedEmails, AllowedEmailsAdmin)
admin.site.register(models.AllowedEmail, AllowedEmailAdmin)
# Register our custom waffle implementations
admin.site.register(models.WaffleFlag, WaffleFlagAdmin)

View file

@ -11,7 +11,7 @@ class Migration(migrations.Migration):
operations = [
migrations.CreateModel(
name="AllowedEmails",
name="AllowedEmail",
fields=[
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
("created_at", models.DateTimeField(auto_now_add=True)),

View file

@ -25,7 +25,7 @@ def create_groups(apps, schema_editor) -> Any:
class Migration(migrations.Migration):
dependencies = [
("registrar", "0119_allowedemails"),
("registrar", "0119_allowedemail"),
]
operations = [

View file

@ -21,7 +21,7 @@ from .portfolio import Portfolio
from .domain_group import DomainGroup
from .suborganization import Suborganization
from .senior_official import SeniorOfficial
from .allowed_emails import AllowedEmails
from .allowed_email import AllowedEmail
__all__ = [
@ -47,7 +47,7 @@ __all__ = [
"DomainGroup",
"Suborganization",
"SeniorOfficial",
"AllowedEmails",
"AllowedEmail",
]
auditlog.register(Contact)
@ -72,4 +72,4 @@ auditlog.register(Portfolio)
auditlog.register(DomainGroup)
auditlog.register(Suborganization)
auditlog.register(SeniorOfficial)
auditlog.register(AllowedEmails)
auditlog.register(AllowedEmail)

View file

@ -3,9 +3,9 @@ from django.db import models
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.
"""

View file

@ -32,6 +32,8 @@
{% include "django/admin/includes/descriptions/website_description.html" %}
{% elif opts.model_name == 'portfolioinvitation' %}
{% include "django/admin/includes/descriptions/portfolio_invitation_description.html" %}
{% elif opts.model_name == 'allowedemail' %}
{% include "django/admin/includes/descriptions/allowed_email_description.html" %}
{% else %}
<p>This table does not have a description yet.</p>
{% endif %}

View file

@ -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>