diff options
Diffstat (limited to 'yaksh/views.py')
-rw-r--r-- | yaksh/views.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/yaksh/views.py b/yaksh/views.py index 440236c..56f1873 100644 --- a/yaksh/views.py +++ b/yaksh/views.py @@ -98,13 +98,14 @@ def get_html_text(md_text): """Takes markdown text and converts it to html""" return Markdown().convert(md_text) + def formfield_callback(field): - if (isinstance(field, models.TextField) - and field.name == 'expected_output' - or field.name == 'expected_input'): + if (isinstance(field, models.TextField) and field.name == 'expected_output' + or field.name == 'expected_input'): return fields.CharField(strip=False) return field.formfield() + @email_verified def index(request, next_url=None): """The start page. @@ -255,7 +256,7 @@ def add_question(request, question_id=None): formset = inlineformset_factory( Question, testcase, extra=0, fields='__all__', - formfield_callback = formfield_callback + formfield_callback=formfield_callback ) formsets.append(formset( request.POST, request.FILES, instance=question @@ -941,10 +942,9 @@ def complete(request, reason=None, attempt_num=None, questionpaper_id=None, """Show a page to inform user that the quiz has been completed.""" user = request.user if questionpaper_id is None: - message = ( - reason or "An Unexpected Error occurred." - " Please contact your instructor/administrator." - ) + message = reason or ("An Unexpected Error occurred. Please " + "contact your instructor/administrator." + ) context = {'message': message} return my_render_to_response(request, 'yaksh/complete.html', context) else: |