You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
The text was updated successfully, but these errors were encountered:
When using
django-fullclean
, Silk causes aValidationError
:{'prof_file': ['This field cannot be blank.']}
.I believe the cause of the issue is that the model field
prof_file
in theRequest
model hasnull=True
but notblank=True
. From the Django documentation:As
prof_file
is aFileField
which is string-based, and it is not required to be unique, this advice holds and the field should haveblank=True
and notnull=True
.p.s. I love this package!
The text was updated successfully, but these errors were encountered: