mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-15 17:17:02 +02:00
Remove timer remnants, cleanup
This commit is contained in:
parent
af272c0cd3
commit
00bcdd1694
9 changed files with 15 additions and 12 deletions
|
@ -32,7 +32,7 @@ from django.contrib.auth.forms import UserChangeForm, UsernameField
|
||||||
from django_admin_multiple_choice_list_filter.list_filters import MultipleChoiceListFilter
|
from django_admin_multiple_choice_list_filter.list_filters import MultipleChoiceListFilter
|
||||||
|
|
||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
from registrar.models.utility.generic_helper import Timer
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -2024,7 +2024,6 @@ class DomainAdmin(ListHeaderAdmin):
|
||||||
return HttpResponseRedirect(reverse("domain", args=(obj.id,)))
|
return HttpResponseRedirect(reverse("domain", args=(obj.id,)))
|
||||||
|
|
||||||
def change_view(self, request, object_id):
|
def change_view(self, request, object_id):
|
||||||
logger.info("Timing change_view on domain")
|
|
||||||
# If the analyst was recently editing a domain page,
|
# If the analyst was recently editing a domain page,
|
||||||
# delete any associated session values
|
# delete any associated session values
|
||||||
if "analyst_action" in request.session:
|
if "analyst_action" in request.session:
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Generated by Django 4.2.10 on 2024-05-07 20:16
|
# Generated by Django 4.2.10 on 2024-05-07 20:32
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
import phonenumber_field.modelfields
|
import phonenumber_field.modelfields
|
||||||
|
@ -92,6 +92,10 @@ class Migration(migrations.Migration):
|
||||||
model_name="domain",
|
model_name="domain",
|
||||||
index=models.Index(fields=["name"], name="registrar_d_name_5b1956_idx"),
|
index=models.Index(fields=["name"], name="registrar_d_name_5b1956_idx"),
|
||||||
),
|
),
|
||||||
|
migrations.AddIndex(
|
||||||
|
model_name="domain",
|
||||||
|
index=models.Index(fields=["state"], name="registrar_d_state_84c134_idx"),
|
||||||
|
),
|
||||||
migrations.AddIndex(
|
migrations.AddIndex(
|
||||||
model_name="domaininvitation",
|
model_name="domaininvitation",
|
||||||
index=models.Index(fields=["status"], name="registrar_d_status_e84571_idx"),
|
index=models.Index(fields=["status"], name="registrar_d_status_e84571_idx"),
|
||||||
|
@ -108,8 +112,4 @@ class Migration(migrations.Migration):
|
||||||
model_name="domainrequest",
|
model_name="domainrequest",
|
||||||
index=models.Index(fields=["status"], name="registrar_d_status_a32b59_idx"),
|
index=models.Index(fields=["status"], name="registrar_d_status_a32b59_idx"),
|
||||||
),
|
),
|
||||||
migrations.AddIndex(
|
|
||||||
model_name="domainrequest",
|
|
||||||
index=models.Index(fields=["generic_org_type"], name="registrar_d_generic_4d1d2a_idx"),
|
|
||||||
),
|
|
||||||
]
|
]
|
||||||
|
|
|
@ -10,6 +10,7 @@ class Contact(TimeStampedModel):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
"""Contains meta information about this class"""
|
"""Contains meta information about this class"""
|
||||||
|
|
||||||
indexes = [
|
indexes = [
|
||||||
models.Index(fields=["user"]),
|
models.Index(fields=["user"]),
|
||||||
models.Index(fields=["email"]),
|
models.Index(fields=["email"]),
|
||||||
|
|
|
@ -67,11 +67,12 @@ class Domain(TimeStampedModel, DomainHelper):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
"""Contains meta information about this class"""
|
"""Contains meta information about this class"""
|
||||||
|
|
||||||
indexes = [
|
indexes = [
|
||||||
models.Index(fields=["name"]),
|
models.Index(fields=["name"]),
|
||||||
|
models.Index(fields=["state"]),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
self._cache = {}
|
self._cache = {}
|
||||||
super(Domain, self).__init__(*args, **kwargs)
|
super(Domain, self).__init__(*args, **kwargs)
|
||||||
|
|
|
@ -24,10 +24,10 @@ class DomainInformation(TimeStampedModel):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
"""Contains meta information about this class"""
|
"""Contains meta information about this class"""
|
||||||
|
|
||||||
indexes = [
|
indexes = [
|
||||||
models.Index(fields=["domain"]),
|
models.Index(fields=["domain"]),
|
||||||
models.Index(fields=["domain_request"]),
|
models.Index(fields=["domain_request"]),
|
||||||
models.Index(fields=["generic_org_type"]),
|
|
||||||
]
|
]
|
||||||
|
|
||||||
StateTerritoryChoices = DomainRequest.StateTerritoryChoices
|
StateTerritoryChoices = DomainRequest.StateTerritoryChoices
|
||||||
|
|
|
@ -17,6 +17,7 @@ logger = logging.getLogger(__name__)
|
||||||
class DomainInvitation(TimeStampedModel):
|
class DomainInvitation(TimeStampedModel):
|
||||||
class Meta:
|
class Meta:
|
||||||
"""Contains meta information about this class"""
|
"""Contains meta information about this class"""
|
||||||
|
|
||||||
indexes = [
|
indexes = [
|
||||||
models.Index(fields=["status"]),
|
models.Index(fields=["status"]),
|
||||||
]
|
]
|
||||||
|
|
|
@ -26,11 +26,11 @@ class DomainRequest(TimeStampedModel):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
"""Contains meta information about this class"""
|
"""Contains meta information about this class"""
|
||||||
|
|
||||||
indexes = [
|
indexes = [
|
||||||
models.Index(fields=["requested_domain"]),
|
models.Index(fields=["requested_domain"]),
|
||||||
models.Index(fields=["approved_domain"]),
|
models.Index(fields=["approved_domain"]),
|
||||||
models.Index(fields=["status"]),
|
models.Index(fields=["status"]),
|
||||||
models.Index(fields=["generic_org_type"]),
|
|
||||||
]
|
]
|
||||||
|
|
||||||
# https://django-auditlog.readthedocs.io/en/latest/usage.html#object-history
|
# https://django-auditlog.readthedocs.io/en/latest/usage.html#object-history
|
||||||
|
|
|
@ -26,6 +26,7 @@ class User(AbstractUser):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
"""Contains meta information about this class"""
|
"""Contains meta information about this class"""
|
||||||
|
|
||||||
indexes = [
|
indexes = [
|
||||||
models.Index(fields=["username"]),
|
models.Index(fields=["username"]),
|
||||||
models.Index(fields=["email"]),
|
models.Index(fields=["email"]),
|
||||||
|
|
|
@ -13,7 +13,8 @@ from django.db.models.functions import Concat, Coalesce
|
||||||
from registrar.models.public_contact import PublicContact
|
from registrar.models.public_contact import PublicContact
|
||||||
from registrar.models.user_domain_role import UserDomainRole
|
from registrar.models.user_domain_role import UserDomainRole
|
||||||
from registrar.utility.enums import DefaultEmail
|
from registrar.utility.enums import DefaultEmail
|
||||||
from registrar.models.utility.generic_helper import Timer
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@ -379,7 +380,6 @@ def write_csv_for_requests(
|
||||||
|
|
||||||
def export_data_type_to_csv(csv_file):
|
def export_data_type_to_csv(csv_file):
|
||||||
"""All domains report with extra columns"""
|
"""All domains report with extra columns"""
|
||||||
logger.info("Timing export_data_type_to_csv")
|
|
||||||
writer = csv.writer(csv_file)
|
writer = csv.writer(csv_file)
|
||||||
# define columns to include in export
|
# define columns to include in export
|
||||||
columns = [
|
columns = [
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue