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

Prevent destination facility from marking shift as complete #2114

Merged
merged 8 commits into from
Jun 24, 2024

Conversation

Ashesh3
Copy link
Member

@Ashesh3 Ashesh3 commented Apr 24, 2024

Related issue: ohcnetwork/care_fe#7684
Frontend change: ohcnetwork/care_fe#7697

Adds a permission check to disallow destination facility staff from marking the shifting request as complete, while still allowing state and district admin to do the same. Also auto discharge is removed for completed stage, and the UI handles the discharge + shifting change together.

@Ashesh3 Ashesh3 requested a review from sainak April 29, 2024 04:29
destination_facility = (
validated_data.get("assigned_facility") or instance.assigned_facility
)
if destination_facility and destination_facility.users.contains(user):
Copy link
Member

Choose a reason for hiding this comment

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

if a user is part of the destination and receiving facility this might become a problem.

@nihal467 nihal467 added the P2 label Jun 4, 2024
@nihal467
Copy link
Member

nihal467 commented Jun 4, 2024

the related frontend PR is having bug, don't merge it

@nihal467
Copy link
Member

LGTM @vigneshhari you can review it, the PR is working

@vigneshhari vigneshhari merged commit 1912662 into develop Jun 24, 2024
9 checks passed
@vigneshhari vigneshhari deleted the shifting-perms branch June 24, 2024 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants