mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-31 23:16:36 +02:00
removed unnecessary code from SeniorOfficialAdmin
This commit is contained in:
parent
07b1010dd4
commit
192a7bb8a4
1 changed files with 0 additions and 17 deletions
|
@ -1404,19 +1404,6 @@ class SeniorOfficialAdmin(ListHeaderAdmin):
|
||||||
# in autocomplete_fields for Senior Official
|
# in autocomplete_fields for Senior Official
|
||||||
ordering = ["first_name", "last_name"]
|
ordering = ["first_name", "last_name"]
|
||||||
|
|
||||||
def get_annotated_queryset(self, queryset):
|
|
||||||
return queryset.annotate(
|
|
||||||
converted_federal_type=Case(
|
|
||||||
# When portfolio is present, use its value instead
|
|
||||||
When(
|
|
||||||
Q(federal_agency__isnull=False),
|
|
||||||
then=F("federal_agency__federal_type"),
|
|
||||||
),
|
|
||||||
# Otherwise, return the natively assigned value
|
|
||||||
default=Value(""),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
||||||
readonly_fields = []
|
readonly_fields = []
|
||||||
|
|
||||||
# Even though this is empty, I will leave it as a stub for easy changes in the future
|
# Even though this is empty, I will leave it as a stub for easy changes in the future
|
||||||
|
@ -1457,10 +1444,6 @@ class SeniorOfficialAdmin(ListHeaderAdmin):
|
||||||
|
|
||||||
# Check if user is in OMB analysts group
|
# Check if user is in OMB analysts group
|
||||||
if request.user.groups.filter(name="omb_analysts_group").exists():
|
if request.user.groups.filter(name="omb_analysts_group").exists():
|
||||||
# annotated_qs = self.get_annotated_queryset(qs)
|
|
||||||
# return annotated_qs.filter(
|
|
||||||
# converted_federal_type=BranchChoices.EXECUTIVE,
|
|
||||||
# )
|
|
||||||
return qs.filter(federal_agency__federal_type=BranchChoices.EXECUTIVE)
|
return qs.filter(federal_agency__federal_type=BranchChoices.EXECUTIVE)
|
||||||
|
|
||||||
return qs # Return full queryset if the user doesn't have the restriction
|
return qs # Return full queryset if the user doesn't have the restriction
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue