-
Notifications
You must be signed in to change notification settings - Fork 1
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
base: develop
Are you sure you want to change the base?
Task/remove statuses from timeline tables/2750 #2872
Conversation
2f2f837
to
323bff2
Compare
There was a problem hiding this 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:
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
323bff2
to
d8fb2fd
Compare
Card: #2750