HEPData / hepdata

Repository for main HEPData web application
https://hepdata.net
GNU General Public License v2.0
40 stars 11 forks source link

records: problem uploading to new Sandbox record from `hepdata-cli` for non-admin user #735

Closed GraemeWatt closed 7 months ago

GraemeWatt commented 7 months ago

If a non-admin user tries to upload to a new Sandbox record using the hepdata-cli upload they get an error message:

HTTPError: 403 Client Error: FORBIDDEN for url: https://www.hepdata.net/record/cli_upload
Reason: Email <email> does not correspond to a confirmed uploader for this record.

This seems to be a bug introduced in PR #329. The check:

https://github.com/HEPData/hepdata/blob/3dfb5311144b3c869f62d345667a0f1f058f60ec/hepdata/modules/records/views.py#L806-L810

should not be made for a new Sandbox record (recid=None).

Thanks to Louie Corpe (@ldcorpe) for reporting this bug.