diff --git a/users/forms.py b/users/forms.py
index 404101d8..604df09b 100644
--- a/users/forms.py
+++ b/users/forms.py
@@ -313,8 +313,6 @@ class AdherentForm(FormRevMixin, FieldPermissionFormMixin, ModelForm):
self.fields['email'].label = _("Email address")
self.fields['school'].label = _("School")
self.fields['comment'].label = _("Comment")
- self.fields['room'].label = _("Room")
- self.fields['room'].empty_label = _("No room")
self.fields['school'].empty_label = _("Select a school")
self.fields['birthday'].label = _("Your birthday")
@@ -337,7 +335,6 @@ class AdherentForm(FormRevMixin, FieldPermissionFormMixin, ModelForm):
'comment',
'birthday',
'disclaimer',
- 'room',
'shell',
'telephone',
'gpg_fingerprint'
diff --git a/users/templates/users/user.html b/users/templates/users/user.html
index c111a67b..1f2e6c56 100644
--- a/users/templates/users/user.html
+++ b/users/templates/users/user.html
@@ -72,26 +72,26 @@ function submitBday() {
{% elif action_name == 'Create a club' %}
{% endif %}
@@ -100,15 +100,15 @@ function submitBday() {
@@ -124,7 +124,7 @@ function submitBday() {
{% else %}
{{ userform.disclaimer.label_tag }}
- {% render_field userform.disclaimer class="form-control" requiered=True %}
+ {% render_field userform.disclaimer class="form-control" %}
{% endif %}
@@ -134,21 +134,18 @@ function submitBday() {
var div = document.getElementById("div_disclaimer");
var input = document.getElementById("{{userform.disclaimer.auto_id}}");
- var Bdate = document.getElementById('{{userform.birthday.auto_id').value;
- var Bday = +new Date(Bdate);
+ var Bdate = document.getElementById('{{userform.birthday.auto_id}}').value;
+ var Bday = +new Date(Bdate.replace(/(\d{2})[-/](\d{2})[-/](\d+)/, "$2/$1/$3"));
var age = ((Date.now() - Bday) / (31557600000));
- console.log("{{userform.disclaimer.auto_id}}");
if (age < 18){
div.style.display = "block";
- input.setAttribute("requiered", "True");
- console.log(input);
+ input.setAttribute("requiered", "True");
}
else{
div.style.display = "none";
input.removeAttribute("requiered");
- console.log(input);
}
}
@@ -156,17 +153,17 @@ function submitBday() {
{% elif action_name == 'Create a club' %}
{{ userform.email.label_tag }}
- {% render_field userform.email class="form-control" requiered=True %}
+ {% render_field userform.email class="form-control" %}
{% endif %}
{{ userform.school.label_tag }}
- {% render_field userform.school class="form-control" requiered=True %}
+ {% render_field userform.school class="form-control" %}
{{ userform.room.label_tag }}
- {% render_field userform.room class="form-control" requiered=True %}
+ {% render_field userform.room class="form-control" %}
{{ userform.comment.label_tag }}