Skip to content

records: don't replace % and \ in table name if using url_for #980

@GraemeWatt

Description

@GraemeWatt

For the new record ins3108682 with complex tables names like Figure 3a t(e) CR merged $U \in [250, 350] GeV$ bin, I noticed that the JSON button on the table record (https://www.hepdata.net/record/172708) returns an error "A data submission with record ID 167738, version 1 and table name 'Figure 3a t(e) CR merged bin' does not exist". Similarly if copying the URL for the table to the clipboard and appending &format=json. I think the reason is due to the replacement replace('\\', '%5C') in the lines:

table_name=request.args['table'].replace('%', '%25').replace('\\', '%5C'),

table_name = request.args['table'].replace('%', '%25').replace('\\', '%5C')

table_name=ctx['table_name'].replace('%', '%25').replace('\\', '%5C'),

Testing locally, the JSON links work after removing the replacement. I think the replacement is no longer needed after simplifying the redirect with Flask url_for in commit 5793558 made last August. This should be tested more thoroughly before committing.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    To do

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions