From f06a5d2ffbb1a06320935841a4ba24720e651985 Mon Sep 17 00:00:00 2001 From: prathamesh Date: Tue, 13 Feb 2018 12:48:19 +0530 Subject: 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 --- grades/forms.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'grades/forms.py') 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'] -- cgit