Skip to content

Commit

Permalink
records: don't check permissions if recid=None
Browse files Browse the repository at this point in the history
* Upload permissions not relevant if creating a new Sandbox record.
* Fixes #735.
  • Loading branch information
GraemeWatt committed Nov 29, 2023
1 parent 3dfb531 commit 25134e3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion hepdata/modules/records/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ def cli_upload():
invitation_cookie = request.form['invitation_cookie'] if 'invitation_cookie' in request.form.keys() else None

# Check the user has upload permissions for this record
if not has_upload_permissions(recid, user, is_sandbox):
if recid and not has_upload_permissions(recid, user, is_sandbox):
return jsonify({
"message": "Email {} does not correspond to a confirmed uploader for this record.".format(str(user_email))
}), 403
Expand Down
2 changes: 1 addition & 1 deletion hepdata/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@
and parsed by ``setup.py``.
"""

__version__ = "0.9.4dev20231115"
__version__ = "0.9.4dev20231129"

0 comments on commit 25134e3

Please sign in to comment.