Eine Menge Aufräumarbeiten.
* Eine Testsuite um Mahrjong Ranking Berechnungen zu testen * Erste Arbeiten um die Workarounds aus dem "utils" Paket los zu werden. * Vieles am Code umformatiert für PEP8 conformität
This commit is contained in:
@@ -3,11 +3,10 @@ Created on 04.10.2011
|
||||
|
||||
@author: christian
|
||||
"""
|
||||
import django.forms
|
||||
from django import forms
|
||||
from django.template.defaultfilters import slugify
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
from utils.html5 import forms
|
||||
from . import models
|
||||
|
||||
|
||||
@@ -35,9 +34,9 @@ class ArticleForm(forms.ModelForm):
|
||||
class PageForm(forms.ModelForm):
|
||||
error_css_class = 'error'
|
||||
required_css_class = 'required'
|
||||
content_type = django.forms.ChoiceField(
|
||||
content_type = forms.ChoiceField(
|
||||
choices=models.CONTENT_CHOICES,
|
||||
widget=django.forms.RadioSelect
|
||||
widget=forms.RadioSelect
|
||||
)
|
||||
|
||||
class Meta(object):
|
||||
@@ -47,7 +46,7 @@ class PageForm(forms.ModelForm):
|
||||
def clean(self):
|
||||
cleaned_data = super(PageForm, self).clean()
|
||||
content_type = cleaned_data.get("content_type")
|
||||
pdf_de = cleaned_data.get("pdf_de")
|
||||
cleaned_data.get("pdf_de")
|
||||
if content_type == "2" and not cleaned_data.get("pdf_de"):
|
||||
msg = _('Please upload a PDF-File to this PDF-Page.')
|
||||
self._errors["content_type"] = self.error_class([msg])
|
||||
|
||||
Reference in New Issue
Block a user