Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task/remove statuses from timeline tables/2750 #2872

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

andrea-williams
Copy link
Contributor

Card: #2750

@andrea-williams andrea-williams marked this pull request as ready for review February 19, 2025 19:48
@andrea-williams andrea-williams force-pushed the task/remove-statuses-from-timeline-tables/2750 branch 2 times, most recently from 2f2f837 to 323bff2 Compare February 20, 2025 18:50
Copy link
Contributor

@BCerki BCerki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Yay deleting code 🕺

Some notes:

  • I think we should keep the test assertions as they are, and if a mock record was being assigned a status of TRANSFERRED, it gets an end date instead. We're not using statuses anymore but it's still relevant that people see/don't see transferred records. The timeline bakers assign an end_date by default so we might have to change that
  • I get an error when I try to make a transfer:
    image
    django.core.exceptions.FieldError: Cannot resolve keyword 'status' into field. Choices are: archived_at, archived_by, archived_by_id, created_at, created_by, created_by_id, end_date, id, operation, operation_id, operator, operator_id, sfo_facility_id, sfo_facility_name, start_date, updated_at, updated_by, updated_by_id

return queryset.filter(operator_id=user_operator.operator_id).exclude(
status=OperationDesignatedOperatorTimeline.Statuses.TRANSFERRED
)
return queryset.filter(operator_id=user_operator.operator_id)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't able to manually check this because I couldn't do a transfer (see overall comments), but I think we'll still need the exclude filtered on end_date instead of status. Otherwise, people will be able to see things the no longer own

@@ -21,7 +21,6 @@ def get_timeline_by_operation_id(

if user.is_industry_user():
UserOperatorService.get_current_user_approved_user_operator_or_raise(user)
base_queryset = base_queryset.exclude(status=FacilityDesignatedOperationTimeline.Statuses.TRANSFERRED)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need the exclude with end_date here too

@@ -22,25 +21,15 @@ def test_unapproved_user_exception():
def test_get_operations_for_industry_user():
approved_user_operator = baker.make_recipe('registration.tests.utils.approved_user_operator')

# transferred operation - should not be returned
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should still test transferred operations aren't returned.

@andrea-williams andrea-williams force-pushed the task/remove-statuses-from-timeline-tables/2750 branch from 323bff2 to d8fb2fd Compare February 25, 2025 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants