git.ithinksw.org
/
philo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added basic docs for entities and attributes.
[philo.git]
/
validators.py
diff --git
a/validators.py
b/validators.py
index
54ab3b1
..
8b39abd
100644
(file)
--- a/
validators.py
+++ b/
validators.py
@@
-1,7
+1,7
@@
from django.utils.translation import ugettext_lazy as _
from django.core.validators import RegexValidator
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from django.core.validators import RegexValidator
from django.core.exceptions import ValidationError
-from django.template import Template, Parser, Lexer, TOKEN_BLOCK, TOKEN_VAR
+from django.template import Template, Parser, Lexer, TOKEN_BLOCK, TOKEN_VAR
, TemplateSyntaxError
from django.utils import simplejson as json
import re
from philo.utils import LOADED_TEMPLATE_ATTR
from django.utils import simplejson as json
import re
from philo.utils import LOADED_TEMPLATE_ATTR
@@
-45,8
+45,8
@@
class URLLinkValidator(RegexValidator):
def json_validator(value):
try:
json.loads(value)
def json_validator(value):
try:
json.loads(value)
- except:
- raise ValidationError(u'
\'%s\' is not valid JSON' % valu
e)
+ except
Exception, e
:
+ raise ValidationError(u'
JSON decode error: %s' %
e)
class TemplateValidationParser(Parser):
class TemplateValidationParser(Parser):