Skip to content

/country/add: deny "add" and "list" as country names #510

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
php-coder opened this issue Dec 7, 2016 · 4 comments
Closed

/country/add: deny "add" and "list" as country names #510

php-coder opened this issue Dec 7, 2016 · 4 comments
Assignees
Milestone

Comments

@php-coder
Copy link
Owner

php-coder commented Dec 7, 2016

Steps to reproduce:

  • login as a user
  • create country with name (in English) "add" (or "list")

Expected result:

  • error message is shown because of invalid name

Actual result:

  • country has been created and user was redirected to /country/add (or /country/list) page
@php-coder php-coder added this to the next milestone Dec 7, 2016
@php-coder php-coder changed the title /country/add: deny add and list as category names /country/add: deny add and list as country names Dec 7, 2016
@php-coder php-coder changed the title /country/add: deny add and list as country names /country/add: deny "add" and "list" as country names Dec 7, 2016
@php-coder php-coder removed the ready label Mar 5, 2017
@php-coder
Copy link
Owner Author

I suggest to add validator DenyValues and pass disallowed values into it:

@DenyValues({"add", "list"})
private String name;

@php-coder
Copy link
Owner Author

@n583wxdh0j Are you still working on this issue? If not, let me know and I'll reassign this issue to someone else.

BTW validator is mostly implemented as part of #509 that will be merged soon.

@n583wxdh0j
Copy link
Contributor

Give me a week.

@php-coder
Copy link
Owner Author

Ok, no problem, thanks for letting me know! Just to reminder that validator has been already implemented, so the fix will be about 3-4 lines of code (plus you should copy&paste existing test)!

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

No branches or pull requests

2 participants