fix without logo
This commit is contained in:
parent
d97eb08cce
commit
b140dc5f89
|
@ -141,6 +141,9 @@ class SanitizationEntityForm(FlaskForm):
|
|||
if not is_valid:
|
||||
return False
|
||||
|
||||
if not self.logo.data:
|
||||
return True
|
||||
|
||||
extensions = ["jpg", "jpeg", "png", "gif", "svg"]
|
||||
if self.logo.data.lower().split(".")[-1] not in extensions:
|
||||
txt = "Error in Url field - accepted only .PNG, .JPG and .GIF. extensions"
|
||||
|
|
|
@ -1565,6 +1565,9 @@ class CustomerDetailsForm(FlaskForm):
|
|||
if not is_valid:
|
||||
return is_valid
|
||||
|
||||
if not self.logo.data:
|
||||
return True
|
||||
|
||||
extensions = ["jpg", "jpeg", "png", "gif", "svg"]
|
||||
if self.logo.data.lower().split(".")[-1] not in extensions:
|
||||
txt = "Error in Url field - accepted only .PNG, .JPG and .GIF. extensions"
|
||||
|
|
|
@ -145,7 +145,8 @@ class SanitizationEntityView(View):
|
|||
messages.error('Error modifying Sanitization data!')
|
||||
if form.errors:
|
||||
for k in form.errors.keys():
|
||||
txt = "{}: {}".format(k, form.errors[k])
|
||||
errors = ", ".join(form.errors[k])
|
||||
txt = "{}: {}".format(k, errors)
|
||||
messages.error(txt)
|
||||
|
||||
return flask.redirect(flask.url_for('core.user-profile'))
|
||||
|
|
Reference in New Issue