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.'
|
||||
|
||||
for field in bundle.data:
|
||||
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.'
|
||||
if bundle.data[field]:
|
||||
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
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
|
||||
{% if not debug %}
|
||||
<script type="text/javascript">
|
||||
|
||||
var _gaq = _gaq || [];
|
||||
|
@ -48,6 +48,6 @@
|
|||
})();
|
||||
</script>
|
||||
{% endif %}
|
||||
{% if debug %}
|
||||
<script>document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1"></' + 'script>')</script>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<script>document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1"></' + 'script>')</script>
|
||||
{% endif %}
|
||||
|
|
Loading…
Reference in New Issue