Commit 309ef85b authored by Zar's avatar Zar

Sex setting modification on profil and matmatronche

parent 42f5773f
Pipeline #2096 failed with stage
in 7 minutes and 30 seconds
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-10-09 20:24
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("core", "0032_auto_20190909_0043")]
operations = [
migrations.AlterField(
model_name="user",
name="sex",
field=models.CharField(
blank=True,
choices=[("MAN", "Man"), ("WOMAN", "Woman")],
max_length=10,
null=True,
verbose_name="sex",
),
)
]
...@@ -201,9 +201,10 @@ class User(AbstractBaseUser): ...@@ -201,9 +201,10 @@ class User(AbstractBaseUser):
) )
sex = models.CharField( sex = models.CharField(
_("sex"), _("sex"),
max_length=10, max_length=20,
null=True,
blank=True,
choices=[("MAN", _("Man")), ("WOMAN", _("Woman"))], choices=[("MAN", _("Man")), ("WOMAN", _("Woman"))],
default="MAN",
) )
tshirt_size = models.CharField( tshirt_size = models.CharField(
_("tshirt size"), _("tshirt size"),
......
This diff is collapsed.
...@@ -43,7 +43,6 @@ ...@@ -43,7 +43,6 @@
{{ form.phone.errors }} {{ form.phone.errors }}
<label for="{{ form.phone.id_for_label }}">{{ form.phone.label }}</label> <label for="{{ form.phone.id_for_label }}">{{ form.phone.label }}</label>
{{ form.phone }} {{ form.phone }}
{{ form.sex.as_hidden() }}
<p><input type="submit" value="{% trans %}Search{% endtrans %}" /></p> <p><input type="submit" value="{% trans %}Search{% endtrans %}" /></p>
</p> </p>
</form> </form>
...@@ -53,7 +52,6 @@ ...@@ -53,7 +52,6 @@
<p> <p>
{{ form.quick.errors }} {{ form.quick.errors }}
<label for="{{ form.quick.id_for_label }}">{{ form.quick.label }}</label> <label for="{{ form.quick.id_for_label }}">{{ form.quick.label }}</label>
{{ form.sex.as_hidden() }}
{{ form.quick }} {{ form.quick }}
<p><input type="submit" value="{% trans %}Search{% endtrans %}" /></p> <p><input type="submit" value="{% trans %}Search{% endtrans %}" /></p>
</p> </p>
......
...@@ -69,17 +69,6 @@ class SearchForm(forms.ModelForm): ...@@ -69,17 +69,6 @@ class SearchForm(forms.ModelForm):
"phone": PhoneNumberInternationalFallbackWidget, "phone": PhoneNumberInternationalFallbackWidget,
} }
sex = forms.ChoiceField(
choices=[
("MAN", _("Man")),
("WOMAN", _("Woman")),
("INDIFFERENT", _("Indifferent")),
],
widget=forms.RadioSelect,
initial="INDIFFERENT",
label=_("Sex"),
)
quick = forms.CharField(label=_("Last/First name or nickname"), max_length=255) quick = forms.CharField(label=_("Last/First name or nickname"), max_length=255)
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
...@@ -150,7 +139,7 @@ class SearchFormListView(FormerSubscriberMixin, SingleObjectMixin, ListView): ...@@ -150,7 +139,7 @@ class SearchFormListView(FormerSubscriberMixin, SingleObjectMixin, ListView):
search_dict = {} search_dict = {}
for key, value in self.valid_form.items(): for key, value in self.valid_form.items():
if key not in ("phone", "quick") and not ( if key not in ("phone", "quick") and not (
value == "" or value is None or value == "INDIFFERENT" value == "" or value is None
): ):
search_dict[key + "__icontains"] = value search_dict[key + "__icontains"] = value
q = q.filter(**search_dict).all() q = q.filter(**search_dict).all()
......
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