give 404 for visiting spec summary before it has content?
The following discussion from !2363 (merged) should be addressed:
-
@cbm755 started a discussion: (+1 comment) - Brand-new server
- instead of following the menus, I just loaded
http://localhost:8000/create/spec/summary
directly: - unsurprisingly it is unhappy to see me at summary before making a page, but maybe the error could be less chaotic:
IntegrityError at /create/spec/summary null value in column "numberOfVersions" of relation "Papers_specification" violates not-null constraint DETAIL: Failing row contains (1, , , null, null, null, null, , , null, null). Request Method: GET Request URL: http://localhost:8000/create/spec/summary Django Version: 4.2.6 Exception Type: IntegrityError Exception Value: null value in column "numberOfVersions" of relation "Papers_specification" violates not-null constraint DETAIL: Failing row contains (1, , , null, null, null, null, , , null, null). Exception Location: /usr/lib/python3.12/site-packages/django/db/backends/utils.py, line 89, in _execute Raised during: SpecCreator.views.util_views.TestSpecSummaryView Python Executable: /usr/bin/python Python Version: 3.12.0 Python Path: ['/home/cbm/src/plom/plom.git/plom_server', '/usr/lib64/python312.zip', '/usr/lib64/python3.12', '/usr/lib64/python3.12/lib-dynload', '/home/cbm/.local/lib/python3.12/site-packages', '/usr/lib64/python3.12/site-packages', '/usr/lib/python3.12/site-packages']
Now its:
ObjectDoesNotExist at /create/spec/summary
The database does not contain a test specification.
Request Method: GET
Request URL: http://localhost:8000/create/spec/summary
Django Version: 4.2.6
Exception Type: ObjectDoesNotExist
Exception Value:
The database does not contain a test specification.
Exception Location: /home/cbm/src/plom/plom.git/plom_server/Papers/services/SpecificationService.py, line 92, in get_the_spec
Raised during: SpecCreator.views.summary.SpecSummaryView
Python Executable: /usr/bin/python
Python Version: 3.12.0
Python Path:
['/home/cbm/src/plom/plom.git/plom_server',
'/usr/lib64/python312.zip',
'/usr/lib64/python3.12',
'/usr/lib64/python3.12/lib-dynload',
'/home/cbm/.local/lib/python3.12/site-packages',
'/usr/lib64/python3.12/site-packages',
'/usr/lib/python3.12/site-packages']
Server time: Fri, 17 Nov 2023 00:31:08 +0000
Which is much better.