diff --git a/questionnaire/qprocessors/timeperiod.py b/questionnaire/qprocessors/timeperiod.py index ff22316..7698398 100644 --- a/questionnaire/qprocessors/timeperiod.py +++ b/questionnaire/qprocessors/timeperiod.py @@ -40,7 +40,7 @@ def question_timeperiod(request, question): @answer_proc('timeperiod') def process_timeperiod(question, answer): - if not answer['ANSWER'] or not 'unit in 'answer: + if not answer['ANSWER'] or not 'unit' in answer: raise AnswerException(_(u"Invalid time period")) period = answer['ANSWER'].strip() if period: diff --git a/questionnaire/utils.py b/questionnaire/utils.py index d058218..3b1bce0 100644 --- a/questionnaire/utils.py +++ b/questionnaire/utils.py @@ -1,6 +1,6 @@ #!/usr/bin/python import codecs -import cStringIO +from six import StringIO import csv from six import text_type as unicodestr @@ -71,7 +71,7 @@ class UnicodeWriter: def __init__(self, f, dialect=csv.excel, encoding="utf-8", **kwds): # Redirect output to a queue - self.queue = cStringIO.StringIO() + self.queue = StringIO() self.writer = csv.writer(self.queue, dialect=dialect, **kwds) self.stream = f self.encoder = codecs.getincrementalencoder(encoding)() diff --git a/setup.py b/setup.py index db5c98b..eb4198b 100644 --- a/setup.py +++ b/setup.py @@ -29,11 +29,11 @@ setup( ], zip_safe=False, install_requires=[ - 'django', - 'django-transmeta', + 'django<2', + 'django-transmeta-eh', 'django-compat', 'pyyaml', - 'pyparsing' + 'pyparsing', 'six' ], setup_requires=[