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

Silk is incompatible with django-fullclean #219

Closed
richardnias opened this issue Oct 12, 2017 · 1 comment
Closed

Silk is incompatible with django-fullclean #219

richardnias opened this issue Oct 12, 2017 · 1 comment

Comments

@richardnias
Copy link
Contributor

richardnias commented Oct 12, 2017

When using django-fullclean, Silk causes a ValidationError: {'prof_file': ['This field cannot be blank.']}.

I believe the cause of the issue is that the model field prof_file in the Request model has null=True but not blank=True. From the Django documentation:

Avoid using null on string-based fields such as CharField and TextField. If a string-based field has null=True, that means it has two possible values for “no data”: NULL, and the empty string. In most cases, it’s redundant to have two possible values for “no data;” the Django convention is to use the empty string, not NULL. One exception is when a CharField has both unique=True and blank=True set. In this situation, null=True is required to avoid unique constraint violations when saving multiple objects with blank values.

As prof_file is a FileField which is string-based, and it is not required to be unique, this advice holds and the field should have blank=True and not null=True.

p.s. I love this package!

@richardnias
Copy link
Contributor Author

Closing this as it was fixed by #220

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

No branches or pull requests

1 participant