Remove converted values from exports + fixes

This commit is contained in:
CocoByte 2024-12-03 15:03:05 -07:00
parent a6308edffe
commit 9a8ac325e5
No known key found for this signature in database
GPG key ID: BBFAA2526384C97F
3 changed files with 133 additions and 214 deletions

View file

@ -539,12 +539,14 @@ class DomainExport(BaseExport):
# When portfolio is present, use its value instead
When(portfolio__isnull=False, then=F("portfolio__organization_type")),
# Otherwise, return the natively assigned value
default=F("organization_type"),
default=F("generic_org_type"),
output_field=CharField(),
),
"converted_federal_agency": Case(
# When portfolio is present, use its value instead
When(portfolio__isnull=False, then=F("portfolio__federal_agency__agency")),
When(
Q(portfolio__isnull=False) & Q(portfolio__federal_agency__isnull=False),
then=F("portfolio__federal_agency__agency")),
# Otherwise, return the natively assigned value
default=F("federal_agency__agency"),
output_field=CharField(),
@ -1628,12 +1630,15 @@ class DomainRequestExport(BaseExport):
# When portfolio is present, use its value instead
When(portfolio__isnull=False, then=F("portfolio__organization_type")),
# Otherwise, return the natively assigned value
default=F("organization_type"),
default=F("generic_org_type"),
output_field=CharField(),
),
"converted_federal_agency": Case(
# When portfolio is present, use its value instead
When(portfolio__isnull=False, then=F("portfolio__federal_agency__agency")),
When(
Q(portfolio__isnull=False) & Q(portfolio__federal_agency__isnull=False),
then=F("portfolio__federal_agency__agency")
),
# Otherwise, return the natively assigned value
default=F("federal_agency__agency"),
output_field=CharField(),