Files
@ b50974263c36
Branch filter:
Location: symposion_app/symposion/proposals/forms.py - annotation
b50974263c36
1.1 KiB
text/x-python
i18n sponsor fields
Feedback from PyConJP development
```
commit 5973e32ebdc231b209b5c058664e8b2b4a1dbc54
Author: MURAOKA Yusuke <yusuke@jbking.org>
Date: Mon Mar 31 15:35:40 2014 +0900
introduce Benefit.content_type which is used to display localized
text
```
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
Feedback from PyConJP development
```
commit 5973e32ebdc231b209b5c058664e8b2b4a1dbc54
Author: MURAOKA Yusuke <yusuke@jbking.org>
Date: Mon Mar 31 15:35:40 2014 +0900
introduce Benefit.content_type which is used to display localized
text
```
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
7596922f4d68 7596922f4d68 7596922f4d68 7596922f4d68 7596922f4d68 7596922f4d68 7596922f4d68 7596922f4d68 7596922f4d68 7596922f4d68 7596922f4d68 36ab6d599ffc 7596922f4d68 7596922f4d68 7596922f4d68 36ab6d599ffc 7596922f4d68 7596922f4d68 7596922f4d68 36ab6d599ffc 7596922f4d68 7596922f4d68 7596922f4d68 7596922f4d68 7596922f4d68 7596922f4d68 7596922f4d68 7596922f4d68 7596922f4d68 7596922f4d68 7596922f4d68 7596922f4d68 7596922f4d68 7596922f4d68 36ab6d599ffc 7596922f4d68 7596922f4d68 7596922f4d68 7596922f4d68 7596922f4d68 7596922f4d68 | from django import forms
from django.db.models import Q
from symposion.proposals.models import SupportingDocument
# from markitup.widgets import MarkItUpWidget
# @@@ generic proposal form
class AddSpeakerForm(forms.Form):
email = forms.EmailField(
label="Email address of new speaker (use their email address, not yours)"
)
def __init__(self, *args, **kwargs):
self.proposal = kwargs.pop("proposal")
super(AddSpeakerForm, self).__init__(*args, **kwargs)
def clean_email(self):
value = self.cleaned_data["email"]
exists = self.proposal.additional_speakers.filter(
Q(user=None, invite_email=value) |
Q(user__email=value)
).exists()
if exists:
raise forms.ValidationError(
"This email address has already been invited to your talk proposal"
)
return value
class SupportingDocumentCreateForm(forms.ModelForm):
class Meta:
model = SupportingDocument
fields = [
"file",
"description",
]
|