Some participant fields were not included in the form template and thus every time the form was saved those values were emptied. We exclude those fileds now within the form class.
18 lines
540 B
Python
18 lines
540 B
Python
# -*- coding: utf-8 -*-
|
|
from django import forms
|
|
|
|
from ..models import Participant
|
|
|
|
|
|
class ParticipantForm(forms.ModelForm):
|
|
class Meta:
|
|
model = Participant
|
|
exclude = ['event', 'created_at', 'position',
|
|
'privacy_policy', 'privacy_policy_accepted',
|
|
'paid', 'purge_at']
|
|
widgets = {
|
|
'emergency_contact': forms.Textarea(attrs={'rows': 4}),
|
|
'experience': forms.Textarea(attrs={'rows': 5}),
|
|
'note': forms.Textarea(attrs={'rows': 5}),
|
|
}
|