summaryrefslogtreecommitdiff
path: root/grades/forms.py
diff options
context:
space:
mode:
authorprathamesh2018-02-13 12:48:19 +0530
committeradityacp2018-03-21 17:32:41 +0530
commitf06a5d2ffbb1a06320935841a4ba24720e651985 (patch)
tree8b72047eafb25abb2b4556ce4633c9b10375ef5b /grades/forms.py
parent24bce890f07b6696ef1e910443a41a54840a6e90 (diff)
downloadonline_test-f06a5d2ffbb1a06320935841a4ba24720e651985.tar.gz
online_test-f06a5d2ffbb1a06320935841a4ba24720e651985.tar.bz2
online_test-f06a5d2ffbb1a06320935841a4ba24720e651985.zip
Change default grading system behaviour
Cannot edit default system. Code as per PEP8 standards. Updates grade after regrade or manual grading Field change from total marks to percentage Removed unused fields from grades app
Diffstat (limited to 'grades/forms.py')
-rw-r--r--grades/forms.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/grades/forms.py b/grades/forms.py
index f8c800a..130659d 100644
--- a/grades/forms.py
+++ b/grades/forms.py
@@ -1,13 +1,8 @@
from grades.models import GradingSystem
from django import forms
-class GradingSystemForm(forms.ModelForm):
- def __init__(self, *args, ** kwargs):
- super(GradingSystemForm, self).__init__(*args, **kwargs)
- system = getattr(self, 'instance', None)
- if system.name == 'default':
- self.fields['name'].widget.attrs['readonly'] = True
+class GradingSystemForm(forms.ModelForm):
class Meta:
model = GradingSystem
- fields = ['name', 'description', 'can_be_used']
+ fields = ['name', 'description']