Skip to content

Commit

Permalink
Merge pull request #613 from edx/py3-support
Browse files Browse the repository at this point in the history
BOM-989 py3-support
  • Loading branch information
Ayub-Khan authored Oct 24, 2019
2 parents 48b8af3 + a7cd684 commit e3be072
Show file tree
Hide file tree
Showing 63 changed files with 468 additions and 546 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ language: python
cache: pip
python:
- 2.7
- 3.6
services:
- xvfb
env:
Expand Down
10 changes: 0 additions & 10 deletions AUTHORS

This file was deleted.

2 changes: 1 addition & 1 deletion edx_proctoring/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
from __future__ import absolute_import

# Be sure to update the version number in edx_proctoring/package.json
__version__ = '2.1.2'
__version__ = '2.1.3'

default_app_config = 'edx_proctoring.apps.EdxProctoringConfig' # pylint: disable=invalid-name
35 changes: 16 additions & 19 deletions edx_proctoring/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,21 @@
from __future__ import absolute_import

from datetime import datetime, timedelta

import pytz

from django import forms
from django.db.models import Q
from django.conf import settings
from django.contrib import admin
from django.contrib import messages
from django.contrib import admin, messages
from django.db.models import Q
from django.utils.translation import ugettext_lazy as _
from edx_proctoring.models import (
ProctoredExam,
ProctoredExamReviewPolicy,
ProctoredExamSoftwareSecureReview,
ProctoredExamSoftwareSecureReviewHistory,
ProctoredExamStudentAttempt,
)

from edx_proctoring.api import update_attempt_status
from edx_proctoring.utils import locate_attempt_by_attempt_code
from edx_proctoring.exceptions import (
ProctoredExamIllegalStatusTransition,
StudentExamAttemptDoesNotExistsException,
)
from edx_proctoring.exceptions import ProctoredExamIllegalStatusTransition, StudentExamAttemptDoesNotExistsException
from edx_proctoring.models import (ProctoredExam, ProctoredExamReviewPolicy, ProctoredExamSoftwareSecureReview,
ProctoredExamSoftwareSecureReviewHistory, ProctoredExamStudentAttempt)
from edx_proctoring.statuses import ProctoredExamStudentAttemptStatus
from edx_proctoring.utils import locate_attempt_by_attempt_code


class ProctoredExamReviewPolicyAdmin(admin.ModelAdmin):
Expand All @@ -38,13 +31,13 @@ class ProctoredExamReviewPolicyAdmin(admin.ModelAdmin):

def course_id(obj):
"""
return course_id of related model
Return course_id of related model
"""
return obj.proctored_exam.course_id

def exam_name(obj):
"""
return exam name of related model
Return exam name of related model
"""
return obj.proctored_exam.exam_name

Expand All @@ -65,7 +58,8 @@ def save_model(self, request, obj, form, change):

class ProctoredExamSoftwareSecureReviewForm(forms.ModelForm):
"""Admin Form to display for reading/updating a Review"""
class Meta(object): # pylint: disable=missing-docstring
class Meta(object):
"""Meta class"""
model = ProctoredExamSoftwareSecureReview
fields = '__all__'

Expand Down Expand Up @@ -294,12 +288,14 @@ def save_model(self, request, review, form, change): # pylint: disable=argument
review.save()

def get_form(self, request, obj=None, **kwargs):
""" Returns software secure review form """
form = super(ProctoredExamSoftwareSecureReviewAdmin, self).get_form(request, obj, **kwargs)
if 'video_url' in form.base_fields:
del form.base_fields['video_url']
return form

def lookup_allowed(self, key, value): # pylint: disable=arguments-differ
""" Checks if lookup allowed or not """
if key == 'exam__course_id':
return True
return super(ProctoredExamSoftwareSecureReviewAdmin, self).lookup_allowed(key, value)
Expand Down Expand Up @@ -364,7 +360,8 @@ class ProctoredExamAttemptForm(forms.ModelForm):
Admin Form to display for reading/updating a Proctored Exam Attempt
"""

class Meta(object): # pylint: disable=missing-docstring
class Meta(object):
""" Meta class """
model = ProctoredExamStudentAttempt
fields = '__all__'

Expand Down
Loading

0 comments on commit e3be072

Please sign in to comment.