Only verify field if field is not null.

master
Nick Sergeant 2013-02-25 15:41:34 -05:00
parent 717ed86a08
commit fe9c8282d9
2 changed files with 7 additions and 6 deletions

View File

@ -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

View File

@ -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 %}