Added validation to email fields where needed.
Apparently Django did not generate an email field when it was required.
Fixes issue 623.
--- a/app/soc/views/models/group.py Tue Jul 14 22:33:37 2009 +0200
+++ b/app/soc/views/models/group.py Wed Jul 15 11:48:43 2009 +0200
@@ -91,6 +91,7 @@
new_params['list_heading'] = 'soc/group/list/heading.html'
new_params['create_extra_dynaproperties'] = {
+ 'email': forms.fields.EmailField(required=True),
'clean_phone': cleaning.clean_phone_number('phone'),
'clean_contact_street': cleaning.clean_ascii_only('contact_street'),
'clean_contact_city': cleaning.clean_ascii_only('contact_city'),
--- a/app/soc/views/models/group_app.py Tue Jul 14 22:33:37 2009 +0200
+++ b/app/soc/views/models/group_app.py Wed Jul 15 11:48:43 2009 +0200
@@ -23,6 +23,7 @@
]
+from django import forms
from django import http
from django.utils.translation import ugettext
@@ -93,6 +94,7 @@
]
new_params['create_extra_dynaproperties'] = {
+ 'email': forms.fields.EmailField(required=True),
'clean_backup_admin_link_id':
cleaning.clean_users_not_same('backup_admin_link_id'),
}
--- a/app/soc/views/models/role.py Tue Jul 14 22:33:37 2009 +0200
+++ b/app/soc/views/models/role.py Wed Jul 15 11:48:43 2009 +0200
@@ -137,6 +137,7 @@
required=False),
'longitude': forms.fields.FloatField(widget=forms.HiddenInput,
required=False),
+ 'email': forms.fields.EmailField(required=True),
'clean_link_id': cleaning.clean_existing_user('link_id'),
'clean_phone': cleaning.clean_phone_number('phone'),
'clean_res_street': cleaning.clean_ascii_only('res_street'),
--- a/app/soc/views/models/site.py Tue Jul 14 22:33:37 2009 +0200
+++ b/app/soc/views/models/site.py Wed Jul 15 11:48:43 2009 +0200
@@ -76,7 +76,7 @@
new_params['create_extra_dynaproperties'] = {
'link_id': forms.CharField(widget=forms.HiddenInput, required=True),
- 'clean_noreply_email': cleaning.clean_empty_field('noreply_email'),
+ 'noreply_email': forms.EmailField(required=False),
}
new_params['edit_extra_dynaproperties'] = {
'link_id': forms.CharField(widget=forms.HiddenInput, required=True),
--- a/app/soc/views/models/student.py Tue Jul 14 22:33:37 2009 +0200
+++ b/app/soc/views/models/student.py Wed Jul 15 11:48:43 2009 +0200
@@ -163,7 +163,7 @@
user_entity = user_logic.logic.getForCurrentAccount()
params['create_form'] = params['user_create_form']
-
+
# pylint: disable-msg=E1103
return self.create(request, access_type='unspecified', page_name=page_name,
params=params, link_id=user_entity.link_id, **kwargs)