From 9e097c99d0d0401c4c33a81d3f3ac15450ca495b Mon Sep 17 00:00:00 2001
From: Yohann D'ANELLO
Date: Thu, 15 Oct 2020 17:14:25 +0200
Subject: [PATCH] Index registrations by first name, last name and email
---
.../search/indexes/registration/adminregistration_text.txt | 1 +
.../search/indexes/registration/coachregistration_text.txt | 4 +++-
.../indexes/registration/studentregistration_text.txt | 4 +++-
locale/fr/LC_MESSAGES/django.po | 6 +++++-
templates/search/search.html | 2 +-
5 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/apps/registration/templates/search/indexes/registration/adminregistration_text.txt b/apps/registration/templates/search/indexes/registration/adminregistration_text.txt
index 44ed471..a5077ab 100644
--- a/apps/registration/templates/search/indexes/registration/adminregistration_text.txt
+++ b/apps/registration/templates/search/indexes/registration/adminregistration_text.txt
@@ -1,4 +1,5 @@
{{ object.user.last_name }}
{{ object.user.first_name }}
+{{ object.user.email }}
{{ object.type }}
{{ object.role }}
diff --git a/apps/registration/templates/search/indexes/registration/coachregistration_text.txt b/apps/registration/templates/search/indexes/registration/coachregistration_text.txt
index e9c5fff..e7e53e5 100644
--- a/apps/registration/templates/search/indexes/registration/coachregistration_text.txt
+++ b/apps/registration/templates/search/indexes/registration/coachregistration_text.txt
@@ -1,4 +1,6 @@
-{{ object.user }}
+{{ object.user.first_name }}
+{{ object.user.last_name }}
+{{ object.user.email }}
{{ object.type }}
{{ object.professional_activity }}
{{ object.team.name }}
diff --git a/apps/registration/templates/search/indexes/registration/studentregistration_text.txt b/apps/registration/templates/search/indexes/registration/studentregistration_text.txt
index 884f15b..1a19e6c 100644
--- a/apps/registration/templates/search/indexes/registration/studentregistration_text.txt
+++ b/apps/registration/templates/search/indexes/registration/studentregistration_text.txt
@@ -1,4 +1,6 @@
-{{ object.user }}
+{{ object.user.first_name }}
+{{ object.user.last_name }}
+{{ object.user.email }}
{{ object.type }}
{{ object.student_class }}
{{ object.school }}
diff --git a/locale/fr/LC_MESSAGES/django.po b/locale/fr/LC_MESSAGES/django.po
index a70138e..a9885db 100644
--- a/locale/fr/LC_MESSAGES/django.po
+++ b/locale/fr/LC_MESSAGES/django.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Corres2math\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2020-10-15 16:01+0200\n"
+"POT-Creation-Date: 2020-10-15 17:12+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Yohann D'ANELLO \n"
"Language-Team: LANGUAGE \n"
@@ -920,3 +920,7 @@ msgstr "Chercher"
#: templates/search/search.html:16
msgid "Results"
msgstr "Résultats"
+
+#: templates/search/search.html:24
+msgid "No results found."
+msgstr "Aucun résultat."
diff --git a/templates/search/search.html b/templates/search/search.html
index 7dfba7e..f798ff3 100644
--- a/templates/search/search.html
+++ b/templates/search/search.html
@@ -21,7 +21,7 @@
{{ result.object }}
{% empty %}
- No results found.
+ {% trans "No results found." %}
{% endfor %}
{% if page.has_previous or page.has_next %}