Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

Add validations for gpx upload #1510

Closed
openstreetmap-trac opened this issue Jul 23, 2021 · 3 comments
Closed

Add validations for gpx upload #1510

openstreetmap-trac opened this issue Jul 23, 2021 · 3 comments

Comments

@openstreetmap-trac
Copy link

Reporter: grand.edgemaster[at]gmail.com
[Submitted to the original trac issue database at 11.12am, Sunday, 18th January 2009]

In create:
Check for user on upload.

In api_create:
Check that the file is provided.

@openstreetmap-trac
Copy link
Author

Author: edgemaster
[Added to the original trac issue at 1.19am, Friday, 23rd January 2009]

(In [13321]) Require auth on calls to /trace/create, and pass through to form if called without params. Adjust validations on traces to prevent dual error messages on description (validates_presence_of catches the empty string removed from length validation)
More changes to come for api_create
References #1510

@openstreetmap-trac
Copy link
Author

Author: edgemaster
[Added to the original trac issue at 7.14pm, Friday, 23rd January 2009]

(In [13331]) Set params to sane defaults if unset by client.
Reject creates with no file with 400, model validations will also reject with 400 (as was existing but broken behaviour)
Closes #1510

@openstreetmap-trac
Copy link
Author

Author: grand.edgemaster[at]gmail.com
[Added to the original trac issue at 7.28pm, Friday, 23rd January 2009]

For the context of any future reviews errors such as the following would occur without the appropriate parameters to api_create:

NoMethodError (You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.split):
    /app/models/trace.rb:27:in `tagstring='

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant