File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed
Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -319,6 +319,20 @@ class Migration(migrations.Migration):
319319 violation_error_message = "Subtype is not valid for the spectrum category" ,
320320 ),
321321 ),
322+ # Ensure unique (owner, subtype) combination
323+ ConditionalAddConstraint (
324+ model_name = "spectrum" ,
325+ constraint = models .UniqueConstraint (
326+ name = "spectrum_unique_owner_subtype" ,
327+ fields = [
328+ "owner_fluor" ,
329+ "owner_filter" ,
330+ "owner_light" ,
331+ "owner_camera" ,
332+ "subtype" ,
333+ ],
334+ ),
335+ ),
322336 # Step 6: Add covering index for metadata-only queries
323337 ConditionalAddIndex (
324338 model_name = "spectrum" ,
Original file line number Diff line number Diff line change 6565 ),
6666 name = "submit-spectra" ,
6767 ),
68+ # Slug-based submission uses legacy form (pre-selects the protein)
69+ re_path (
70+ r"^spectra/submit/(?P<slug>[-\w]+)/$" ,
71+ (
72+ login_required (
73+ views .SpectrumCreateView .as_view (),
74+ message = "You must be logged in to submit spectra" ,
75+ )
76+ if CONTRIBS_OPEN
77+ else disabled
78+ ),
79+ name = "submit-spectra" ,
80+ ),
6881 path (
6982 "spectra/submitted/" ,
7083 views .spectrum_submitted_v2 ,
You can’t perform that action at this time.
0 commit comments