Coverage for chapters\forms\admin_forms.py : 67%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
super(ChapterChangeForm, self).clean() clean_number_of_chapter(self) return self.cleaned_data
exclude = self._get_validation_exclusions() exclude.remove( 'fanfic') # allow checking against the missing attribute try: self.instance.validate_unique(exclude=exclude) except ValidationError as e: self._update_errors(e.message_dict)
'fanfic': SelectCustomWidget(attrs={'class': 'custom-select'}) }
""" Clean the number of the chapter """
self.add_error( 'num_chapter', "The number of the chapter has to be greater " "than zero.") except Exception: self.add_error('num_chapter', "The value is not valid")
|