mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-26 02:54:20 +00:00
Merge branch 'genderMatmatroncheV2' into 'master'
Remove gender option of matmatronche & update gender settings Afin de se mettre à jour il est dorénavant possible de ne pas définir son genre sexué sur l'édit de son profil. D'ailleurs j'ai découvert que de base pour un profil random le sexe était défini sur "Homme" maintenant il est en "-------" ! ![image](/uploads/43e9f32dc545b35cbe422a53602b2457/image.png) De plus afin que personnes n'utilisent l'outil matmatronche à des fins de site de rencontres en cherchant uniquement les "Homme" ou les "Femme" d'une promo etc... Le choix du sexe dans la recherche a été supprimé. ![image](/uploads/e6e75d5661862178acfbe71f3f7efc35/image.png) C'est la première fois que je fais une modification en solo alors n'hésitez pas à me casser en deux et m'expliquer si j'ai fauté :D See merge request ae/Sith!264
This commit is contained in:
commit
2cbe6fa11c
24
core/migrations/0035_auto_20200216_1743.py
Normal file
24
core/migrations/0035_auto_20200216_1743.py
Normal file
@ -0,0 +1,24 @@
|
||||
# Generated by Django 2.2.10 on 2020-02-16 16:43
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("core", "0034_operationlog"),
|
||||
]
|
||||
|
||||
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",
|
||||
),
|
||||
),
|
||||
]
|
@ -225,8 +225,9 @@ class User(AbstractBaseUser):
|
||||
sex = models.CharField(
|
||||
_("sex"),
|
||||
max_length=10,
|
||||
null=True,
|
||||
blank=True,
|
||||
choices=[("MAN", _("Man")), ("WOMAN", _("Woman"))],
|
||||
default="MAN",
|
||||
)
|
||||
tshirt_size = models.CharField(
|
||||
_("tshirt size"),
|
||||
|
@ -43,7 +43,6 @@
|
||||
{{ form.phone.errors }}
|
||||
<label for="{{ form.phone.id_for_label }}">{{ form.phone.label }}</label>
|
||||
{{ form.phone }}
|
||||
{{ form.sex.as_hidden() }}
|
||||
<p><input type="submit" value="{% trans %}Search{% endtrans %}" /></p>
|
||||
</p>
|
||||
</form>
|
||||
@ -53,7 +52,6 @@
|
||||
<p>
|
||||
{{ form.quick.errors }}
|
||||
<label for="{{ form.quick.id_for_label }}">{{ form.quick.label }}</label>
|
||||
{{ form.sex.as_hidden() }}
|
||||
{{ form.quick }}
|
||||
<p><input type="submit" value="{% trans %}Search{% endtrans %}" /></p>
|
||||
</p>
|
||||
|
@ -69,17 +69,6 @@ class SearchForm(forms.ModelForm):
|
||||
"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)
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
@ -150,7 +139,7 @@ class SearchFormListView(FormerSubscriberMixin, SingleObjectMixin, ListView):
|
||||
search_dict = {}
|
||||
for key, value in self.valid_form.items():
|
||||
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
|
||||
q = q.filter(**search_dict).all()
|
||||
|
Loading…
Reference in New Issue
Block a user