Skip to content
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

SQLAlcehmy unique prevents edit on model #1007

Closed
sbehrens opened this issue Aug 21, 2015 · 4 comments
Closed

SQLAlcehmy unique prevents edit on model #1007

sbehrens opened this issue Aug 21, 2015 · 4 comments

Comments

@sbehrens
Copy link

Even if a user edits a model and only updates non unique fields, the application throws an error suggesting that when a user edits something every field is updated regardless if it is changed or not. This prevents a user from restricting the creation of models with a unique name, but editing a model and adding an additional optional attribute like email.

Confirmed on Flask-Admin==1.2.0

@pawl
Copy link
Contributor

pawl commented Aug 27, 2015

@sbehrens I'm having trouble reproducing this one with this gist: https://gist.github.com/pawl/edeb9d1f974d34f3da7a

@pawl
Copy link
Contributor

pawl commented Aug 28, 2015

Closing this until we can get more details on how to reproduce this issue.

@pawl pawl closed this as completed Aug 28, 2015
@pawl
Copy link
Contributor

pawl commented Aug 28, 2015

Nevermind, looks like there's other issues already open for this in #782, #946, #486

There's a workaround mentioned here: #486 (comment)

@pawl
Copy link
Contributor

pawl commented Apr 7, 2016

Made a comment here: Netflix-Skunkworks/sleepy-puppy#7 (comment)

It's an issue caused by using flask_wtf's Form as flask-admin's base form. If you're using it just for csrf validation, I'd recommend using flask-admin's SecureForm: https://flask-admin.readthedocs.org/en/latest/advanced/#enabling-csrf-protection

@pawl pawl closed this as completed Apr 7, 2016
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants