Commit 4a089e2f authored by Matthieu Gautier's avatar Matthieu Gautier

Rename phone field into contact field.

As the model `phone` field is a textField. Let store whatever the
user enter in it. (Yes, that's nasty :/ )
parent 9fec557c
......@@ -43,7 +43,7 @@ class MessageForm(forms.Form):
localize=True)
address = forms.CharField(label=_("Locality"), widget=forms.Textarea,
required=False)
phone = forms.CharField(label=_("Phone number"), required=False)
contact = forms.CharField(label=_("Contact (Phone or email)"), required=False)
text = forms.CharField(label=_("Text"), widget=RichTextEntry,
required=False)
media = forms.FileField(
......
......@@ -26,7 +26,7 @@
{% endif %}
{% if content.author.phone %}
<p>
<span class="menu-subtitle">{% trans "Phone number:" %}</span>
<span class="menu-subtitle">{% trans "Contact:" %}</span>
{{ content.author.phone }}
</p>
{% endif %}
......
......@@ -37,7 +37,7 @@
{% endif %}
{% if content.author.phone %}
<p>
<span class="menu-subtitle">{% trans "Phone number:" %}</span>
<span class="menu-subtitle">{% trans "Contact:" %}</span>
{{ content.author.phone }}
</p>
{% endif %}
......
......@@ -20,7 +20,7 @@
{% form_field form.author %}
{% form_field form.birth_year %}
{% form_field form.address %}
{% form_field form.phone %}
{% form_field form.contact %}
{% endblock sidebar %}
{% block extra_foot %}
......
......@@ -73,7 +73,9 @@ class MessageCreate(FormView):
serial=user_serial,
full_name=author,
birth_year=form.cleaned_data['birth_year'],
phone=form.cleaned_data['phone'],
# This is a nasty hack, we store the contact that can be
# something else than a phone number in the phone field.
phone=form.cleaned_data['contact'],
camp_address=form.cleaned_data['address'])
break
except IntegrityError:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment