#3914 Add validators for the API field types on create_new_project
Closed by lenkaseg. Opened by lenkaseg.
Unknown source master

Download 3914.patch

Partly fixes #2485.

I added the sqlalchemy validators for the field types for create new project.
Is it ok like this? (If yes, I'll do the same with create new issue and so on.)

I had some problems with validating the create_readme field => should be boolean. While testing, even when I was passing non boolean value, no exception was raised. Then I figured out, that create_readme always switches to "False', which then passes as bool. Do you have any idea why this happens or should I investigate more?

The rest should be working, but since it's still not finished I was not running the tests.

This looks neat but it's adding some code without removing any, shouldn't this allow us to drop some of our existing code?
Also, out of curiosity, did you see any issue with the current code or is it more a general improvement in the way of validating things?

The only validation I found was that name and description cannot be empty. You mean to drop these?
You mean why I used sqlalchemy validators? I just saw it later in model.py as an ssh_key validation and I googled a nice example of how to write it :)

I'm closing this :)

Pull-Request has been closed by lenkaseg

Metadata