Commit b270c762 authored by Sli's avatar Sli
Browse files

Merge branch 'galaRequests' into 'master'

Some gala requests: new minor features

See merge request !247
parents 660a3161 aac4e3b9
Pipeline #2091 failed with stage
in 60 minutes and 5 seconds
......@@ -15,7 +15,7 @@
<p>{% trans %}Your account doesn't have access to this page. To proceed,
please login with an account that has access.{% endtrans %}</p>
{% else %}
<p>{% trans %}Please login to see this page.{% endtrans %}</p>
<p>{% trans %}Please login or create an account to see this page.{% endtrans %}</p>
{% endif %}
{% endif %}
......@@ -30,5 +30,6 @@
{# Assumes you setup the password_reset view in your URLconf #}
<p><a href="{{ url('core:password_reset') }}">{% trans %}Lost password?{% endtrans %}</a></p>
<p><a href="{{ url('core:register') }}">{% trans %}Create account{% endtrans %}</a></p>
{% endblock %}
......@@ -490,7 +490,7 @@ class Selling(models.Model):
event = self.product.eticket.event_title or _("Unknown event")
subject = _("Eticket bought for the event %(event)s") % {"event": event}
message_html = _(
"You bought an eticket for the event %(event)s.\nYou can download it on this page %(url)s."
"You bought an eticket for the event %(event)s.\nYou can download it directly from this link %(eticket)s.\nYou can also retrieve all your e-tickets on your account page %(url)s."
) % {
"event": event,
"url": "".join(
......@@ -502,10 +502,23 @@ class Selling(models.Model):
"</a>",
)
),
"eticket": "".join(
(
'<a href="',
self.get_eticket_full_url(),
'">',
self.get_eticket_full_url(),
"</a>",
)
),
}
message_txt = _(
"You bought an eticket for the event %(event)s.\nYou can download it on this page %(url)s."
) % {"event": event, "url": self.customer.get_full_url()}
"You bought an eticket for the event %(event)s.\nYou can download it directly from this link %(eticket)s.\nYou can also retrieve all your e-tickets on your account page %(url)s."
) % {
"event": event,
"url": self.customer.get_full_url(),
"eticket": self.get_eticket_full_url(),
}
self.customer.user.email_user(subject, message_txt, html_message=message_html)
def save(self, allow_negative=False, *args, **kwargs):
......@@ -568,11 +581,6 @@ class Selling(models.Model):
start=sub.subscription_start,
)
sub.save()
try:
if self.product.eticket:
self.send_mail_customer()
except:
pass
if self.customer.user.preferences.notify_on_click:
Notification(
user=self.customer.user,
......@@ -588,6 +596,16 @@ class Selling(models.Model):
type="SELLING",
).save()
super(Selling, self).save(*args, **kwargs)
try:
# The product has no id until it's saved
if self.product.eticket:
self.send_mail_customer()
except:
pass
def get_eticket_full_url(self):
eticket_url = reverse("counter:eticket_pdf", kwargs={"selling_id": self.id})
return "".join(["https://", settings.SITH_URL, eticket_url])
class Permanency(models.Model):
......
......@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-09-10 16:45+0200\n"
"POT-Creation-Date: 2019-10-13 17:21+0200\n"
"PO-Revision-Date: 2016-07-18\n"
"Last-Translator: Skia <skia@libskia.so>\n"
"Language-Team: AE info <ae.info@utbm.fr>\n"
......@@ -16,12 +16,12 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: accounting/models.py:61 accounting/models.py:110 accounting/models.py:138
#: accounting/models.py:203 club/models.py:48 com/models.py:230
#: com/models.py:247 counter/models.py:121 counter/models.py:149
#: counter/models.py:211 forum/models.py:58 launderette/models.py:38
#: launderette/models.py:90 launderette/models.py:125 stock/models.py:40
#: stock/models.py:60 stock/models.py:100 stock/models.py:127
#: accounting/models.py:61 accounting/models.py:110 accounting/models.py:143
#: accounting/models.py:216 club/models.py:48 com/models.py:277
#: com/models.py:294 counter/models.py:121 counter/models.py:149
#: counter/models.py:213 forum/models.py:58 launderette/models.py:38
#: launderette/models.py:93 launderette/models.py:131 stock/models.py:40
#: stock/models.py:63 stock/models.py:105 stock/models.py:134
msgid "name"
msgstr "nom"
......@@ -65,116 +65,116 @@ msgstr "IBAN"
msgid "account number"
msgstr "numero de compte"
#: accounting/models.py:113 accounting/models.py:139 club/models.py:266
#: com/models.py:74 com/models.py:218 com/models.py:251 counter/models.py:166
#: counter/models.py:212 trombi/models.py:205
#: accounting/models.py:116 accounting/models.py:147 club/models.py:275
#: com/models.py:75 com/models.py:264 com/models.py:300 counter/models.py:167
#: counter/models.py:215 trombi/models.py:217
msgid "club"
msgstr "club"
#: accounting/models.py:116
#: accounting/models.py:121
msgid "Bank account"
msgstr "Compte en banque"
#: accounting/models.py:141
#: accounting/models.py:153
msgid "bank account"
msgstr "compte en banque"
#: accounting/models.py:145
#: accounting/models.py:158
msgid "Club account"
msgstr "Compte club"
#: accounting/models.py:190
#: accounting/models.py:203
#, python-format
msgid "%(club_account)s on %(bank_account)s"
msgstr "%(club_account)s sur %(bank_account)s"
#: accounting/models.py:201 club/models.py:268 counter/models.py:591
#: election/models.py:18 launderette/models.py:180
#: accounting/models.py:214 club/models.py:281 counter/models.py:616
#: election/models.py:18 launderette/models.py:194
msgid "start date"
msgstr "date de début"
#: accounting/models.py:202 club/models.py:269 counter/models.py:592
#: accounting/models.py:215 club/models.py:282 counter/models.py:617
#: election/models.py:19
msgid "end date"
msgstr "date de fin"
#: accounting/models.py:204
#: accounting/models.py:217
msgid "is closed"
msgstr "est fermé"
#: accounting/models.py:206 accounting/models.py:521
#: accounting/models.py:222 accounting/models.py:549
msgid "club account"
msgstr "compte club"
#: accounting/models.py:208 accounting/models.py:268 counter/models.py:56
#: counter/models.py:348
#: accounting/models.py:225 accounting/models.py:289 counter/models.py:56
#: counter/models.py:354
msgid "amount"
msgstr "montant"
#: accounting/models.py:209
#: accounting/models.py:226
msgid "effective_amount"
msgstr "montant effectif"
#: accounting/models.py:212
#: accounting/models.py:229
msgid "General journal"
msgstr "Classeur"
#: accounting/models.py:264
#: accounting/models.py:281
msgid "number"
msgstr "numéro"
#: accounting/models.py:266
#: accounting/models.py:286
msgid "journal"
msgstr "classeur"
#: accounting/models.py:269 core/models.py:813 core/models.py:1349
#: core/models.py:1395 core/models.py:1424 counter/models.py:353
#: counter/models.py:446 counter/models.py:615 eboutic/models.py:42
#: eboutic/models.py:85 forum/models.py:298 forum/models.py:391
#: stock/models.py:99
#: accounting/models.py:290 core/models.py:825 core/models.py:1363
#: core/models.py:1411 core/models.py:1440 counter/models.py:364
#: counter/models.py:457 counter/models.py:646 eboutic/models.py:46
#: eboutic/models.py:93 forum/models.py:311 forum/models.py:408
#: stock/models.py:104
msgid "date"
msgstr "date"
#: accounting/models.py:270 counter/models.py:123 counter/models.py:616
#: pedagogy/models.py:215 stock/models.py:102
#: accounting/models.py:291 counter/models.py:123 counter/models.py:647
#: pedagogy/models.py:219 stock/models.py:107
msgid "comment"
msgstr "commentaire"
#: accounting/models.py:272 counter/models.py:355 counter/models.py:448
#: subscription/models.py:64
#: accounting/models.py:293 counter/models.py:366 counter/models.py:459
#: subscription/models.py:66
msgid "payment method"
msgstr "méthode de paiement"
#: accounting/models.py:277
#: accounting/models.py:298
msgid "cheque number"
msgstr "numéro de chèque"
#: accounting/models.py:282 eboutic/models.py:166
#: accounting/models.py:303 eboutic/models.py:178
msgid "invoice"
msgstr "facture"
#: accounting/models.py:286
#: accounting/models.py:308
msgid "is done"
msgstr "est fait"
#: accounting/models.py:290
#: accounting/models.py:312
msgid "simple type"
msgstr "type simplifié"
#: accounting/models.py:297 accounting/models.py:462
#: accounting/models.py:320 accounting/models.py:487
msgid "accounting type"
msgstr "type comptable"
#: accounting/models.py:304 accounting/models.py:450 accounting/models.py:485
#: accounting/models.py:519 core/models.py:1423 counter/models.py:412
#: accounting/models.py:328 accounting/models.py:475 accounting/models.py:510
#: accounting/models.py:545 core/models.py:1439 counter/models.py:423
msgid "label"
msgstr "étiquette"
#: accounting/models.py:310
#: accounting/models.py:334
msgid "target type"
msgstr "type de cible"
#: accounting/models.py:313 club/models.py:415
#: accounting/models.py:337 club/models.py:438
#: club/templates/club/club_members.jinja:16
#: club/templates/club/club_old_members.jinja:8
#: club/templates/club/mailing.jinja:41
......@@ -186,7 +186,7 @@ msgstr "type de cible"
msgid "User"
msgstr "Utilisateur"
#: accounting/models.py:314 club/models.py:320
#: accounting/models.py:338 club/models.py:334
#: club/templates/club/club_detail.jinja:12
#: com/templates/com/mailing_admin.jinja:11
#: com/templates/com/news_admin_list.jinja:23
......@@ -210,36 +210,36 @@ msgstr "Utilisateur"
msgid "Club"
msgstr "Club"
#: accounting/models.py:315 core/views/user.py:297
#: accounting/models.py:339 core/views/user.py:286
msgid "Account"
msgstr "Compte"
#: accounting/models.py:316
#: accounting/models.py:340
msgid "Company"
msgstr "Entreprise"
#: accounting/models.py:317 sith/settings.py:377
#: accounting/models.py:341 sith/settings.py:377
#: stock/templates/stock/shopping_list_items.jinja:37
msgid "Other"
msgstr "Autre"
#: accounting/models.py:320
#: accounting/models.py:344
msgid "target id"
msgstr "id de la cible"
#: accounting/models.py:322
#: accounting/models.py:346
msgid "target label"
msgstr "nom de la cible"
#: accounting/models.py:327
#: accounting/models.py:351
msgid "linked operation"
msgstr "opération liée"
#: accounting/models.py:346
#: accounting/models.py:371
msgid "The date must be set."
msgstr "La date doit être indiquée."
#: accounting/models.py:350
#: accounting/models.py:375
#, python-format
msgid ""
"The date can not be before the start date of the journal, which is\n"
......@@ -248,16 +248,16 @@ msgstr ""
"La date ne peut pas être avant la date de début du journal, qui est\n"
"%(start_date)s."
#: accounting/models.py:360
#: accounting/models.py:385
msgid "Target does not exists"
msgstr "La cible n'existe pas."
#: accounting/models.py:363
#: accounting/models.py:388
msgid "Please add a target label if you set no existing target"
msgstr ""
"Merci d'ajouter un nom de cible si vous ne spécifiez pas de cible existante"
#: accounting/models.py:368
#: accounting/models.py:393
msgid ""
"You need to provide ether a simplified accounting type or a standard "
"accounting type"
......@@ -265,41 +265,41 @@ msgstr ""
"Vous devez fournir soit un type comptable simplifié ou un type comptable "
"standard"
#: accounting/models.py:442 counter/models.py:159 pedagogy/models.py:46
#: accounting/models.py:467 counter/models.py:159 pedagogy/models.py:46
msgid "code"
msgstr "code"
#: accounting/models.py:446
#: accounting/models.py:471
msgid "An accounting type code contains only numbers"
msgstr "Un code comptable ne contient que des numéros"
#: accounting/models.py:452
#: accounting/models.py:477
msgid "movement type"
msgstr "type de mouvement"
#: accounting/models.py:454
#: accounting/models.py:479
#: accounting/templates/accounting/journal_statement_nature.jinja:9
#: accounting/templates/accounting/journal_statement_person.jinja:12
#: accounting/views.py:602
msgid "Credit"
msgstr "Crédit"
#: accounting/models.py:455
#: accounting/models.py:480
#: accounting/templates/accounting/journal_statement_nature.jinja:28
#: accounting/templates/accounting/journal_statement_person.jinja:40
#: accounting/views.py:602
msgid "Debit"
msgstr "Débit"
#: accounting/models.py:456
#: accounting/models.py:481
msgid "Neutral"
msgstr "Neutre"
#: accounting/models.py:489
#: accounting/models.py:514
msgid "simplified accounting types"
msgstr "type simplifié"
#: accounting/models.py:493
#: accounting/models.py:519
msgid "simplified type"
msgstr "type simplifié"
......@@ -381,7 +381,7 @@ msgstr "Compte en banque : "
#: pedagogy/templates/pedagogy/guide.jinja:90
#: pedagogy/templates/pedagogy/guide.jinja:126
#: pedagogy/templates/pedagogy/uv_detail.jinja:185
#: sas/templates/sas/album.jinja:26 sas/templates/sas/moderation.jinja:18
#: sas/templates/sas/album.jinja:27 sas/templates/sas/moderation.jinja:18
#: sas/templates/sas/picture.jinja:74 sas/templates/sas/picture.jinja:124
#: stock/templates/stock/stock_shopping_list.jinja:43
#: stock/templates/stock/stock_shopping_list.jinja:69
......@@ -391,7 +391,7 @@ msgid "Delete"
msgstr "Supprimer"
#: accounting/templates/accounting/bank_account_details.jinja:18
#: club/views.py:78 core/views/user.py:207 sas/templates/sas/picture.jinja:86
#: club/views.py:78 core/views/user.py:196 sas/templates/sas/picture.jinja:86
msgid "Infos"
msgstr "Infos"
......@@ -425,7 +425,7 @@ msgstr "Nouveau compte club"
#: com/templates/com/weekmail.jinja:61 core/templates/core/file.jinja:38
#: core/templates/core/group_list.jinja:24 core/templates/core/page.jinja:35
#: core/templates/core/poster_list.jinja:40
#: core/templates/core/user_tools.jinja:42 core/views/user.py:239
#: core/templates/core/user_tools.jinja:42 core/views/user.py:228
#: counter/templates/counter/cash_summary_list.jinja:53
#: counter/templates/counter/counter_list.jinja:17
#: counter/templates/counter/counter_list.jinja:33
......@@ -440,7 +440,7 @@ msgstr "Nouveau compte club"
#: pedagogy/templates/pedagogy/guide.jinja:89
#: pedagogy/templates/pedagogy/guide.jinja:125
#: pedagogy/templates/pedagogy/uv_detail.jinja:184
#: sas/templates/sas/album.jinja:18 sas/templates/sas/picture.jinja:100
#: sas/templates/sas/album.jinja:19 sas/templates/sas/picture.jinja:100
#: trombi/templates/trombi/detail.jinja:9
#: trombi/templates/trombi/edit_profile.jinja:34
msgid "Edit"
......@@ -631,7 +631,7 @@ msgstr "No"
#: core/templates/core/user_account_detail.jinja:78
#: counter/templates/counter/cash_summary_list.jinja:34
#: counter/templates/counter/last_ops.jinja:14
#: counter/templates/counter/last_ops.jinja:39 sas/views.py:353
#: counter/templates/counter/last_ops.jinja:39 sas/views.py:369
#: stock/templates/stock/stock_shopping_list.jinja:25
#: stock/templates/stock/stock_shopping_list.jinja:54
#: trombi/templates/trombi/user_profile.jinja:40
......@@ -673,7 +673,7 @@ msgstr "Effectuées"
#: pedagogy/templates/pedagogy/uv_detail.jinja:138
#: trombi/templates/trombi/comment.jinja:4
#: trombi/templates/trombi/comment.jinja:8
#: trombi/templates/trombi/user_tools.jinja:50
#: trombi/templates/trombi/user_tools.jinja:51
msgid "Comment"
msgstr "Commentaire"
......@@ -969,7 +969,7 @@ msgid "Begin date"
msgstr "Date de début"
#: club/forms.py:169 com/views.py:85 com/views.py:210 counter/views.py:1564
#: election/views.py:190 subscription/views.py:52
#: election/views.py:178 subscription/views.py:52
msgid "End date"
msgstr "Date de fin"
......@@ -998,15 +998,15 @@ msgstr "Vous ne pouvez pas ajouter deux fois le même utilisateur"
msgid "You should specify a role"
msgstr "Vous devez choisir un rôle"
#: club/forms.py:290 sas/views.py:129 sas/views.py:195 sas/views.py:286
#: club/forms.py:290 sas/views.py:130 sas/views.py:196 sas/views.py:295
msgid "You do not have the permission to do that"
msgstr "Vous n'avez pas la permission de faire cela"
#: club/models.py:51
#: club/models.py:53
msgid "unix name"
msgstr "nom unix"
#: club/models.py:58
#: club/models.py:60
msgid ""
"Enter a valid unix name. This value may contain only letters, numbers ./-/_ "
"characters."
......@@ -1014,94 +1014,94 @@ msgstr ""
"Entrez un nom UNIX valide. Cette valeur peut contenir uniquement des "
"lettres, des nombres, et les caractères ./-/_"
#: club/models.py:63
#: club/models.py:65
msgid "A club with that unix name already exists."
msgstr "Un club avec ce nom UNIX existe déjà."
#: club/models.py:66
#: club/models.py:68
msgid "logo"
msgstr "logo"
#: club/models.py:68
#: club/models.py:70
msgid "is active"
msgstr "actif"
#: club/models.py:70
#: club/models.py:72
msgid "short description"
msgstr "description courte"
#: club/models.py:72 core/models.py:260
#: club/models.py:74 core/models.py:260
msgid "address"
msgstr "Adresse"
#: club/models.py:89 core/models.py:173
#: club/models.py:94 core/models.py:173
msgid "home"
msgstr "home"
#: club/models.py:111
#: club/models.py:118
msgid "You can not make loops in clubs"
msgstr "Vous ne pouvez pas faire de boucles dans les clubs"
#: club/models.py:125
#: club/models.py:132
msgid "A club with that unix_name already exists"
msgstr "Un club avec ce nom UNIX existe déjà."
#: club/models.py:260 counter/models.py:587 counter/models.py:610
#: eboutic/models.py:40 eboutic/models.py:83 election/models.py:180
#: launderette/models.py:134 launderette/models.py:190 sas/models.py:239
#: trombi/models.py:203
#: club/models.py:267 counter/models.py:607 counter/models.py:637
#: eboutic/models.py:42 eboutic/models.py:89 election/models.py:192
#: launderette/models.py:145 launderette/models.py:213 sas/models.py:244
#: trombi/models.py:213
msgid "user"
msgstr "nom d'utilisateur"
#: club/models.py:271 core/models.py:224 election/models.py:178
#: election/models.py:204 trombi/models.py:206
#: club/models.py:284 core/models.py:224 election/models.py:187
#: election/models.py:223 trombi/models.py:218
msgid "role"
msgstr "rôle"
#: club/models.py:276 core/models.py:73 counter/models.py:122
#: counter/models.py:150 election/models.py:15 election/models.py:117
#: election/models.py:182 forum/models.py:59 forum/models.py:231
#: club/models.py:289 core/models.py:73 counter/models.py:122
#: counter/models.py:150 election/models.py:15 election/models.py:120
#: election/models.py:197 forum/models.py:59 forum/models.py:240
msgid "description"
msgstr "description"
#: club/models.py:286
#: club/models.py:299
msgid "past member"
msgstr "Anciens membres"
#: club/models.py:323 club/models.py:420
#: club/models.py:341 club/models.py:444
msgid "Email address"
msgstr "Adresse email"
#: club/models.py:331
#: club/models.py:349
msgid "Enter a valid address. Only the root of the address is needed."
msgstr ""
"Entrez une adresse valide. Seule la racine de l'adresse est nécessaire."
#: club/models.py:335 com/models.py:78 com/models.py:259 core/models.py:814
#: club/models.py:353 com/models.py:83 com/models.py:310 core/models.py:826
msgid "is moderated"
msgstr "est modéré"
#: club/models.py:337 com/models.py:80 com/models.py:263
#: club/models.py:357 com/models.py:87 com/models.py:314
msgid "moderator"
msgstr "modérateur"
#: club/models.py:342
#: club/models.py:364
msgid "This mailing list already exists."
msgstr "Cette liste de diffusion existe déjà."
#: club/models.py:408 club/templates/club/mailing.jinja:23
#: club/models.py:430 club/templates/club/mailing.jinja:23
msgid "Mailing"
msgstr "Liste de diffusion"
#: club/models.py:427
#: club/models.py:451
msgid "At least user or email is required"
msgstr "Au moins un utilisateur ou un email est nécessaire"
#: club/models.py:435 club/tests.py:633
#: club/models.py:459 club/tests.py:633
msgid "This email is already suscribed in this mailing"
msgstr "Cet email est déjà abonné à cette mailing"
#: club/models.py:461
#: club/models.py:485
msgid "Unregistered user"
msgstr "Utilisateur non enregistré"
......@@ -1363,8 +1363,8 @@ msgstr "Anciens membres"
msgid "History"
msgstr "Historique"
#: club/views.py:115 core/templates/core/base.jinja:119 core/views/user.py:230
#: sas/templates/sas/picture.jinja:95 trombi/views.py:60
#: club/views.py:115 core/templates/core/base.jinja:119 core/views/user.py:219
#: sas/templates/sas/picture.jinja:95 trombi/views.py:61
msgid "Tools"
msgstr "Outils"
......@@ -1419,9 +1419,9 @@ msgstr "Hebdomadaire"
msgid "Call"
msgstr "Appel"
#: com/models.py:68 com/models.py:154 com/models.py:212 election/models.py:14
#: election/models.py:116 election/models.py:156 forum/models.py:242
#: forum/models.py:296 pedagogy/models.py:100
#: com/models.py:68 com/models.py:175 com/models.py:253 election/models.py:14
#: election/models.py:119 election/models.py:159 forum/models.py:251
#: forum/models.py:309 pedagogy/models.py:101
msgid "title"
msgstr "titre"
......@@ -1429,70 +1429,70 @@ msgstr "titre"
msgid "summary"
msgstr "résumé"
#: com/models.py:70 com/models.py:213 trombi/models.py:188
#: com/models.py:70 com/models.py:254 trombi/models.py:197
msgid "content"
msgstr "contenu"
#: com/models.py:72 core/models.py:1393 launderette/models.py:95
#: launderette/models.py:130 launderette/models.py:182 stock/models.py:77
#: stock/models.py:131
#: com/models.py:72 core/models.py:1409 launderette/models.py:101
#: launderette/models.py:139 launderette/models.py:196 stock/models.py:80
#: stock/models.py:138
msgid "type"
msgstr "type"
#: com/models.py:76 com/models.py:215 pedagogy/models.py:61
#: pedagogy/models.py:210 trombi/models.py:183
#: com/models.py:80 com/models.py:258 pedagogy/models.py:61
#: pedagogy/models.py:211 trombi/models.py:187
msgid "author"
msgstr "auteur"
#: com/models.py:141
#: com/models.py:153
msgid "news_date"
msgstr "date de la nouvelle"
#: com/models.py:142
#: com/models.py:156
msgid "start_date"