Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'develop' of https://github.com/localprojects/Change-By-Us

… into develop
  • Loading branch information...
commit 0c28ea79de18647d25d9ee7556a158e48a0ccb1c 2 parents cbd05c9 + 53ba737
Ethan Holda authored
Showing with 7 additions and 4 deletions.
  1. +7 −4 controllers/rest.py
View
11 controllers/rest.py
@@ -426,9 +426,12 @@ def instance_to_dict(self, row):
d = {}
for columnName in row.__mapper__.columns.keys():
d[columnName] = getattr(row, columnName)
- if str(row.__mapper__.columns.get('name').type).startswith('VARCHAR'):
- d[columnName] = jinja2.Markup(d[columnName]).unescape()
-
+ try:
+ if str(row.__mapper__.columns.get('name').type).startswith('VARCHAR'):
+ d[columnName] = jinja2.Markup(d[columnName]).unescape()
+ except Exception, e:
+ log.debug("Exception decoding field %s: %s" % (columnName, e))
+
return d
def query_to_list(self, query):
@@ -449,7 +452,7 @@ def dict_to_instance(self, data, instance=None):
val = jinja2.escape(val).encode('ascii','xmlcharrefreplace')
if len(val) > 0: val = safeuni(val)
except Exception, e:
- log.debug("Exception encoding field %s: %s" % key, e)
+ log.debug("Exception encoding field %s: %s" % (key, e))
pass
setattr(instance, key, val)
Please sign in to comment.
Something went wrong with that request. Please try again.