Only verify field if field is not null.
parent
717ed86a08
commit
fe9c8282d9
|
@ -41,8 +41,9 @@ class UserProfileValidation(Validation):
|
||||||
return 'You must be a Pro to change these settings.'
|
return 'You must be a Pro to change these settings.'
|
||||||
|
|
||||||
for field in bundle.data:
|
for field in bundle.data:
|
||||||
if not re.match('^[ A-Za-z0-9\/\@\._-]*$', bundle.data[field]):
|
if bundle.data[field]:
|
||||||
errors[field] = 'Only spaces, letters, numbers, underscores, dashes, periods, forward slashes, and "at sign" are valid.'
|
if not re.match('^[ A-Za-z0-9\/\@\._-]*$', bundle.data[field]):
|
||||||
|
errors[field] = 'Only spaces, letters, numbers, underscores, dashes, periods, forward slashes, and "at sign" are valid.'
|
||||||
|
|
||||||
return errors
|
return errors
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
|
{% if not debug %}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
var _gaq = _gaq || [];
|
var _gaq = _gaq || [];
|
||||||
|
@ -48,6 +48,6 @@
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if debug %}
|
{% else %}
|
||||||
<script>document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1"></' + 'script>')</script>
|
<script>document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1"></' + 'script>')</script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
Loading…
Reference in New Issue