ModellingWebLab / WebLab

Django-based front-end for the modelling Web Lab v2
Other
3 stars 2 forks source link

Relax constraints on allowed file names #160

Closed MichaelClerx closed 5 years ago

MichaelClerx commented 5 years ago
the name 'data-sine-wave-cell-5.csv' contains reserved characters; only alpha-numeric characters, underscores and periods are allowed.
jonc125 commented 5 years ago

What would you like to constrain/allow?

MichaelClerx commented 5 years ago

Is there a need to constrain anything? Probably don't want whitespace at start/end, or entirely whitespace. And some maximum length. But beyond that?

jonc125 commented 5 years ago

There's another side of this: the URL pattern for file downloads needs to support allowed characters. That's what's causing this error:

ERROR 2019-05-23 09:18:54,752 django.request: Internal Server Error: /experiments/932/versions/1004/files.json

NoReverseMatch at /experiments/932/versions/1004/files.json
Reverse for 'file_download' with arguments '(932, 1004, 'oxmeta%3Amembrane_rapid_delayed_rectifier_potassium_current_conductance_histogram_gnuplot_data.csv')' not found. 1 pattern(s) tried: ['experiments/(?P<experiment_pk>\\d+)/versions/(?P<pk>\\d+)/download/(?P<filename>[\\w\\-.]+)$']
MichaelClerx commented 5 years ago

Those are probably sensible rules for us to use too then!