Skip to content

Commit

Permalink
Use text_type instead str
Browse files Browse the repository at this point in the history
  • Loading branch information
drnextgis committed May 4, 2016
1 parent b521207 commit ce42b2b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ps_alchemy/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import transaction
from pyramid.view import view_config, view_defaults
from sacrud.common import pk_list_to_dict
from pyramid.compat import escape
from pyramid.compat import escape, text_type
from pyramid_sacrud import PYRAMID_SACRUD_VIEW
from pyramid.renderers import render_to_response
from sqlalchemy.orm.exc import NoResultFound
Expand All @@ -30,7 +30,7 @@ def preprocessing_value(key, value, form):
for groups in form.children:
for column in groups:
if column.name == key:
if not str(value).isdigit() and isinstance(
if not text_type(value).isdigit() and isinstance(
column.typ,
(colander.Int, colander.Integer,
colander.Float, colander.Decimal)):
Expand Down Expand Up @@ -180,7 +180,7 @@ def delete_view(self):
self.commit()
self.flash_message(
_ps("You have removed object of ${name}",
mapping={'name': escape(str(self.context.obj) or '')}))
mapping={'name': escape(text_type(self.context.obj) or '')}))
return self.list_view_response()

@view_config(
Expand Down

0 comments on commit ce42b2b

Please sign in to comment.