Feature #41 | Fix - physical sample draft fields get lost after saving - #131
Open
gabrielakuhn wants to merge 2 commits into
Open
Feature #41 | Fix - physical sample draft fields get lost after saving#131gabrielakuhn wants to merge 2 commits into
gabrielakuhn wants to merge 2 commits into
Conversation
gabrielakuhn
force-pushed
the
wip-feat-41-igsn-fix-draft
branch
from
June 30, 2026 11:50
43649d2 to
1cc3472
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feat-41/igsn #131 +/- ##
=============================================
Coverage 16.33% 16.33%
=============================================
Files 21 21
Lines 11447 11447
Branches 2246 2246
=============================================
Hits 1870 1870
Misses 9386 9386
Partials 191 191 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
6 tasks
gabrielakuhn
requested review from
kairoaraujo
and removed request for
kairoaraujo
July 2, 2026 14:54
gabrielakuhn
force-pushed
the
wip-feat-41-igsn-fix-draft
branch
from
July 3, 2026 09:42
1cc3472 to
02c021f
Compare
gabrielakuhn
marked this pull request as ready for review
July 3, 2026 09:42
gabrielakuhn
force-pushed
the
wip-feat-41-igsn-fix-draft
branch
from
July 6, 2026 15:06
02c021f to
664f754
Compare
kairoaraujo
reviewed
Jul 31, 2026
kairoaraujo
left a comment
Collaborator
There was a problem hiding this comment.
Check if caught it correct, please.
| "sample_owner_name": validator.string_value (record, "sample_owner_name", 0, 255, False), | ||
| "sample_owner_email": validator.string_value (record, "sample_owner_email", 0, 255, False), | ||
| "group_id": validator.integer_value (record, "group_id", 0, pow(2, 63), False), | ||
| "agreed_to_deposit_agreement": validator.boolean_value (record, "agreed_to_deposit_agreement", False, False), |
Collaborator
There was a problem hiding this comment.
this makes the agreements writable on draft-save but it doesn't check the review state, and the template already disables these checkboxes under review. So an API caller can still flip the agreements back to false on an under-review sample. We could skip just these two params when its under review so the backend matches the UI?
* src/djehuty/web/database.py: Fix cache prefixes invalidated on physical sample update and remove a redundant second run of the update. * src/djehuty/web/wsgi.py: Persist the alternate identifier when saving a physical sample draft.
* src/djehuty/web/wsgi.py: Save the deposit and publish agreement when saving a physical sample draft and when submitting it for review. * src/djehuty/web/database.py: Accept and store the deposit and publish agreement on physical sample update. * src/djehuty/web/resources/sparql_templates/update_physical_sample_draft.sparql: Update the deposit and publish agreement triples. * src/djehuty/web/resources/sparql_templates/physical-samples.sparql: Return the deposit and publish agreement of a physical sample. * src/djehuty/web/resources/static/js/edit-physical-sample.js: Send the deposit and publish agreement when saving a draft. * src/djehuty/web/resources/html_templates/depositor/edit-physical-sample.html: Pre-fill the agreement checkboxes from the saved draft and keep them visible but read-only while under review.
gabrielakuhn
force-pushed
the
wip-feat-41-igsn-fix-draft
branch
from
July 31, 2026 16:09
664f754 to
9803a48
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When save a physical sample as a draft or submitting it to review, some fields get lost after saving because of 2 reasons: cache was not invalidating the correct and some data were not persistent.
Changes
web: Fix physical sample draft fields lost after saving
physical sample update, remove a redundant second run of the update and
persist the deposit and publish agreement on update.
and publish agreement when saving a physical sample draft.
Update the deposit and publish agreement triples.
the deposit and publish agreement of a physical sample.
deposit and publish agreement when saving a draft.
Show the agreement checkboxes pre-filled from the saved draft and keep
them visible but read-only when it is under review.
Approval Checklist
**Issue Reference **
Part of #41
Notes
Branch forked from wip-feat-41-igsn-issued-date