Skip to content

[LIMS-1535] Lock out editing pre-session information 24h before session#7

Merged
gfrn merged 2 commits intomasterfrom
feature/lims-1535/lock-pre-session
Jul 10, 2025
Merged

[LIMS-1535] Lock out editing pre-session information 24h before session#7
gfrn merged 2 commits intomasterfrom
feature/lims-1535/lock-pre-session

Conversation

@gfrn
Copy link
Collaborator

@gfrn gfrn commented Jul 8, 2025

JIRA ticket: LIMS-1535

Summary:

Since modifying experimental parameters shortly before the session may confuse local contacts, it would be preferable to lock these out for regular users, and force them to email staff to make any further amendments.

Changes:

  • Lock out regular users from editing pre-session information 24h before session
  • Return lock state when getting pre-session information

To test:

Either log in as a non-staff user, or comment line 90 in src/scaup/utils/session.py. Either way, these are tested in unit tests.

  • Send a PUT request to /shipments/2/preSession, check if 400 is returned
  • Send a GET request to /shipments/2/preSession, check if isLocked is true
  • Send the same PUT request, but now as a staff member, check if it goes through successfully

@codecov
Copy link

codecov bot commented Jul 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.20%. Comparing base (b3e462e) to head (bf66bd1).

Additional details and impacted files
@@            Coverage Diff             @@
##           master       #7      +/-   ##
==========================================
+ Coverage   93.77%   94.20%   +0.42%     
==========================================
  Files          38       38              
  Lines        1527     1552      +25     
==========================================
+ Hits         1432     1462      +30     
+ Misses         95       90       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@ndg63276 ndg63276 left a comment

Choose a reason for hiding this comment

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

LGTM

@gfrn gfrn merged commit 4e26111 into master Jul 10, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants