summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoradityacp2017-01-05 15:51:35 +0530
committeradityacp2017-01-05 15:51:35 +0530
commit5f29daff88815e3ba87a2ff5933086e505e41581 (patch)
tree6bb30fb5397ba95fc92539cd23e4879d91310ef5
parent3f9773c4eb2a21902ccdefab89c7f503a08f1743 (diff)
downloadonline_test-5f29daff88815e3ba87a2ff5933086e505e41581.tar.gz
online_test-5f29daff88815e3ba87a2ff5933086e505e41581.tar.bz2
online_test-5f29daff88815e3ba87a2ff5933086e505e41581.zip
Fix cli for python 3
-rw-r--r--yaksh/models.py2
-rw-r--r--yaksh/scripts/cli.py4
2 files changed, 2 insertions, 4 deletions
diff --git a/yaksh/models.py b/yaksh/models.py
index a91f4d2..9fd4f9b 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -232,7 +232,7 @@ class Question(models.Model):
type = models.CharField(max_length=24, choices=question_types)
# The type of evaluator
- #test_case_type = models.CharField(max_length=24, choices=test_case_types)
+ test_case_type = models.CharField(max_length=24, choices=test_case_types)
# Is this question active or not. If it is inactive it will not be used
# when creating a QuestionPaper.
diff --git a/yaksh/scripts/cli.py b/yaksh/scripts/cli.py
index 283cb12..1489af7 100644
--- a/yaksh/scripts/cli.py
+++ b/yaksh/scripts/cli.py
@@ -11,7 +11,7 @@ from django.conf import settings
from django.core import management
from django.template import Template, Context
-from project_detail import NAME, PATH
+from .project_detail import NAME, PATH
CUR_DIR = os.getcwd()
SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__))
@@ -136,10 +136,8 @@ def _render_demo_files(template_path, output_path, context=None):
with open(template_path, 'r') as template_file:
content = template_file.read()
if context:
- content = content.decode('utf-8')
template = Template(content)
content = template.render(context)
- content = content.encode('utf-8')
with open(output_path, 'w') as new_file:
new_file.write(content)