mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-05-05 12:41:49 +02:00
Py3 fixes
This commit is contained in:
parent
ef1f3b29ec
commit
a256bca398
2 changed files with 4 additions and 4 deletions
|
@ -56,7 +56,7 @@ class TestCase(unittest.TestCase):
|
|||
})
|
||||
|
||||
def create_project(self, name):
|
||||
models.db.session.add(models.Project(id=name, name=unicode(name),
|
||||
models.db.session.add(models.Project(id=name, name=name,
|
||||
password=name, contact_email="%s@notmyidea.org" % name))
|
||||
models.db.session.commit()
|
||||
|
||||
|
|
|
@ -12,10 +12,10 @@ def slugify(value):
|
|||
|
||||
Copy/Pasted from ametaireau/pelican/utils itself took from django sources.
|
||||
"""
|
||||
if type(value) == unicode:
|
||||
if type(value) == str:
|
||||
import unicodedata
|
||||
value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore')
|
||||
value = unicode(re.sub('[^\w\s-]', '', value).strip().lower())
|
||||
value = unicodedata.normalize('NFKD', value)
|
||||
value = re.sub('[^\w\s-]', '', value).strip().lower()
|
||||
return re.sub('[-\s]+', '-', value)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue