Skip to content

Commit

Permalink
Use text_type from six library
Browse files Browse the repository at this point in the history
  • Loading branch information
drnextgis committed May 4, 2016
1 parent b521207 commit 7fd67bd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ps_alchemy/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@
MassActionResource
)

from six import text_type


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 +182,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
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ peppercorn
transaction
zope.sqlalchemy
paginate_sqlalchemy
six

0 comments on commit 7fd67bd

Please sign in to comment.