mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-18 10:29:23 +02:00
Linting
This commit is contained in:
parent
f48e1f8689
commit
ba025f2c6a
4 changed files with 18 additions and 22 deletions
|
@ -681,13 +681,10 @@ class ExportDataTest(MockDb, MockEppLib):
|
|||
}
|
||||
|
||||
all_requests = DomainRequest.objects.filter(**filter_condition).order_by(*sort_fields).distinct()
|
||||
all_requests_dict = all_requests.values(
|
||||
"requested_domain_name",
|
||||
"generic_org_type",
|
||||
"federal_type",
|
||||
"submission_date"
|
||||
extra = all_requests.values("requested_domain_name", "generic_org_type", "federal_type", "submission_date")
|
||||
DomainRequestExport.write_csv_for_requests(
|
||||
writer, columns, all_requests, extra_request_fields=extra, should_write_header=True
|
||||
)
|
||||
DomainRequestExport.write_csv_for_requests(writer, columns, requests=all_requests_dict, should_write_header=True)
|
||||
# Reset the CSV file's position to the beginning
|
||||
csv_file.seek(0)
|
||||
# Read the content into a variable
|
||||
|
@ -695,9 +692,7 @@ class ExportDataTest(MockDb, MockEppLib):
|
|||
# We expect READY domains first, created between today-2 and today+2, sorted by created_at then name
|
||||
# and DELETED domains deleted between today-2 and today+2, sorted by deleted then name
|
||||
expected_content = (
|
||||
"Domain request,Domain type\n"
|
||||
"city3.gov,Federal - Executive\n"
|
||||
"city4.gov,Federal - Executive\n"
|
||||
"Domain request,Domain type\n" "city3.gov,Federal - Executive\n" "city4.gov,Federal - Executive\n"
|
||||
)
|
||||
|
||||
# Normalize line endings and remove commas,
|
||||
|
|
|
@ -6,11 +6,10 @@ from registrar.models import (
|
|||
DomainInvitation,
|
||||
DomainRequest,
|
||||
DomainInformation,
|
||||
User,
|
||||
PublicContact,
|
||||
UserDomainRole,
|
||||
)
|
||||
from django.db.models import QuerySet, Value, Case, When, CharField, Count, Q, F, Value, CharField
|
||||
from django.db.models import QuerySet, Value, Case, When, CharField, Count, Q, F
|
||||
from django.utils import timezone
|
||||
from django.core.paginator import Paginator
|
||||
from django.db.models.functions import Concat, Coalesce
|
||||
|
@ -909,13 +908,14 @@ class DomainRequestExport:
|
|||
"status",
|
||||
"requested_domain__name",
|
||||
]
|
||||
requests = DomainRequest.objects.select_related(
|
||||
requests = (
|
||||
DomainRequest.objects.select_related(
|
||||
"creator", "authorizing_official", "federal_agency", "investigator", "requested_domain"
|
||||
).exclude(
|
||||
status__in=excluded_statuses
|
||||
).order_by(
|
||||
*order_by
|
||||
).distinct()
|
||||
)
|
||||
.exclude(status__in=excluded_statuses)
|
||||
.order_by(*order_by)
|
||||
.distinct()
|
||||
)
|
||||
extra_fields = DomainRequestExport.annotate_and_prepare_domain_request_data(requests)
|
||||
|
||||
DomainRequestExport.write_csv_for_requests(writer, columns, requests, extra_fields, should_write_header=True)
|
||||
|
|
|
@ -165,8 +165,9 @@ class ExportDataFederal(View):
|
|||
|
||||
|
||||
class ExportDomainRequestDataFull(View):
|
||||
"""Generates a downloaded report containing all Domain Requests (except started)"""
|
||||
def get(self, request, *args, **kwargs):
|
||||
# Smaller export based on 1
|
||||
"""Returns a content disposition response for current-full-domain-request.csv"""
|
||||
response = HttpResponse(content_type="text/csv")
|
||||
response["Content-Disposition"] = 'attachment; filename="current-full-domain-request.csv"'
|
||||
csv_export.DomainRequestExport.export_full_domain_request_report(response)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue