Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
AE UTBM
Sith
Commits
3239a2e4
Commit
3239a2e4
authored
Sep 01, 2016
by
Skia
🤘
Browse files
Fix counter if no date of birth
parent
d27f62dc
Pipeline
#168
failed with stage
in 1 minute and 51 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
counter/templates/counter/counter_click.jinja
View file @
3239a2e4
...
...
@@ -39,6 +39,9 @@
{%
if
request.session
[
'not_allowed'
]
%}
<p><strong>
{%
trans
%}
Not allowed for that product
{%
endtrans
%}
</strong></p>
{%
endif
%}
{%
if
request.session
[
'no_age'
]
%}
<p><strong>
{%
trans
%}
No date of birth provided
{%
endtrans
%}
</strong></p>
{%
endif
%}
{%
if
request.session
[
'not_enough'
]
%}
<p><strong>
{%
trans
%}
Not enough money
{%
endtrans
%}
</strong></p>
{%
endif
%}
...
...
counter/views.py
View file @
3239a2e4
...
...
@@ -121,9 +121,10 @@ class CounterClick(DetailView):
if
'basket'
not
in
request
.
session
.
keys
():
# Init the basket session entry
request
.
session
[
'basket'
]
=
{}
request
.
session
[
'basket_total'
]
=
0
request
.
session
[
'not_enough'
]
=
False
request
.
session
[
'not_enough'
]
=
False
# Reset every variable
request
.
session
[
'too_young'
]
=
False
request
.
session
[
'not_allowed'
]
=
False
request
.
session
[
'no_age'
]
=
False
self
.
refill_form
=
None
ret
=
super
(
CounterClick
,
self
).
get
(
request
,
*
args
,
**
kwargs
)
if
((
self
.
object
.
type
!=
"BAR"
and
not
request
.
user
.
is_authenticated
())
or
...
...
@@ -144,9 +145,10 @@ class CounterClick(DetailView):
if
'basket'
not
in
request
.
session
.
keys
():
request
.
session
[
'basket'
]
=
{}
request
.
session
[
'basket_total'
]
=
0
request
.
session
[
'not_enough'
]
=
False
request
.
session
[
'not_enough'
]
=
False
# Reset every variable
request
.
session
[
'too_young'
]
=
False
request
.
session
[
'not_allowed'
]
=
False
request
.
session
[
'no_age'
]
=
False
if
self
.
object
.
type
!=
"BAR"
:
self
.
operator
=
request
.
user
elif
self
.
is_barman_price
():
...
...
@@ -228,7 +230,10 @@ class CounterClick(DetailView):
if
self
.
customer
.
amount
<
(
total
+
q
*
float
(
price
)):
# Check for enough money
request
.
session
[
'not_enough'
]
=
True
return
False
if
self
.
customer
.
user
.
get_age
()
<
product
.
limit_age
:
# Check if affordable
if
product
.
limit_age
>=
18
and
not
self
.
customer
.
user
.
date_of_birth
:
request
.
session
[
'no_age'
]
=
True
return
False
if
self
.
customer
.
user
.
date_of_birth
and
self
.
customer
.
user
.
get_age
()
<
product
.
limit_age
:
# Check if affordable
request
.
session
[
'too_young'
]
=
True
return
False
if
pid
in
request
.
session
[
'basket'
]:
# Add if already in basket
...
...
locale/fr/LC_MESSAGES/django.mo
View file @
3239a2e4
No preview for this file type
locale/fr/LC_MESSAGES/django.po
View file @
3239a2e4
...
...
@@ -6,7 +6,7 @@
msgid
""
msgstr
""
"Report-Msgid-Bugs-To:
\n
"
"POT-Creation-Date: 2016-09-01 1
1:17
+0200
\n
"
"POT-Creation-Date: 2016-09-01 1
6:54
+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
"
...
...
@@ -123,7 +123,7 @@ msgstr "numéro"
msgid
"journal"
msgstr
"classeur"
#: accounting/models.py:179 core/models.py:458 core/models.py:73
4
#: accounting/models.py:179 core/models.py:458 core/models.py:73
6
#: counter/models.py:203 counter/models.py:246 counter/models.py:296
#: eboutic/models.py:15 eboutic/models.py:48
msgid
"date"
...
...
@@ -172,7 +172,7 @@ msgstr "Utilisateur"
msgid
"Club"
msgstr
"Club"
#: accounting/models.py:190 core/templates/core/user_base.jinja:
49
#: accounting/models.py:190 core/templates/core/user_base.jinja:
51
msgid
"Account"
msgstr
"Compte"
...
...
@@ -325,7 +325,7 @@ msgstr "Nouveau compte club"
#: accounting/templates/accounting/club_account_details.jinja:53
#: accounting/templates/accounting/journal_details.jinja:66
#: club/templates/club/club_detail.jinja:8 core/templates/core/file.jinja:38
#: core/templates/core/page.jinja:31 core/templates/core/user_base.jinja:3
1
#: core/templates/core/page.jinja:31 core/templates/core/user_base.jinja:3
3
#: core/templates/core/user_tools.jinja:33
#: counter/templates/counter/counter_list.jinja:20
#: launderette/templates/launderette/launderette_list.jinja:14
...
...
@@ -469,7 +469,7 @@ msgid "Done"
msgstr
"Effectué"
#: accounting/templates/accounting/journal_details.jinja:34
#: counter/views.py:56
1
#: counter/views.py:56
6
msgid
"Comment"
msgstr
"Commentaire"
...
...
@@ -934,7 +934,7 @@ msgstr "Montrez vos statistiques de compte aux autres"
msgid
"file name"
msgstr
"nom du fichier"
#: core/models.py:450 core/models.py:58
3
#: core/models.py:450 core/models.py:58
5
msgid
"parent"
msgstr
"parent"
...
...
@@ -946,11 +946,11 @@ msgstr "fichier"
msgid
"owner"
msgstr
"propriétaire"
#: core/models.py:453 core/models.py:5
8
9
#: core/models.py:453 core/models.py:59
1
msgid
"edit group"
msgstr
"groupe d'édition"
#: core/models.py:454 core/models.py:59
0
#: core/models.py:454 core/models.py:59
2
msgid
"view group"
msgstr
"groupe de vue"
...
...
@@ -966,61 +966,61 @@ msgstr "type mime"
msgid
"size"
msgstr
"taille"
#: core/models.py:48
7
#: core/models.py:48
9
msgid
"Character '/' not authorized in name"
msgstr
"Le caractère '/' n'est pas autorisé dans les noms de fichier"
#: core/models.py:49
0
core/models.py:49
5
#: core/models.py:49
2
core/models.py:49
7
msgid
"Loop in folder tree"
msgstr
"Boucle dans l'arborescence des dossiers"
#: core/models.py:
499
#: core/models.py:
501
msgid
"You can not make a file be a children of a non folder file"
msgstr
""
"Vous ne pouvez pas mettre un fichier enfant de quelque chose qui n'est pas "
"un dossier"
#: core/models.py:50
3
#: core/models.py:50
5
msgid
"Duplicate file"
msgstr
"Un fichier de ce nom existe déjà"
#: core/models.py:51
3
#: core/models.py:51
5
msgid
"You must provide a file"
msgstr
"Vous devez fournir un fichier"
#: core/models.py:5
38
#: core/models.py:5
40
msgid
"Folder: "
msgstr
"Dossier : "
#: core/models.py:54
0
#: core/models.py:54
2
msgid
"File: "
msgstr
"Fichier : "
#: core/models.py:58
2
core/models.py:58
6
#: core/models.py:58
4
core/models.py:58
8
msgid
"page name"
msgstr
"nom de la page"
#: core/models.py:58
7
#: core/models.py:58
9
msgid
"owner group"
msgstr
"groupe propriétaire"
#: core/models.py:6
18
#: core/models.py:6
20
msgid
"Duplicate page"
msgstr
"Une page de ce nom existe déjà"
#: core/models.py:62
4
#: core/models.py:62
6
msgid
"Loop in page tree"
msgstr
"Boucle dans l'arborescence des pages"
#: core/models.py:73
1
#: core/models.py:73
3
msgid
"revision"
msgstr
"révision"
#: core/models.py:73
2
#: core/models.py:73
4
msgid
"page title"
msgstr
"titre de la page"
#: core/models.py:73
3
#: core/models.py:73
5
msgid
"page content"
msgstr
"contenu de la page"
...
...
@@ -1049,7 +1049,7 @@ msgstr "Connexion"
msgid
"Register"
msgstr
"S'enregister"
#: core/templates/core/base.jinja:25 core/templates/core/user_base.jinja:1
8
#: core/templates/core/base.jinja:25 core/templates/core/user_base.jinja:1
9
msgid
"Tools"
msgstr
"Outils"
...
...
@@ -1127,7 +1127,7 @@ msgstr "Confirmation"
#: core/templates/core/delete_confirm.jinja:14
#: core/templates/core/file_delete_confirm.jinja:14
#: counter/templates/counter/counter_click.jinja:7
3
#: counter/templates/counter/counter_click.jinja:7
6
msgid
"Cancel"
msgstr
"Annuler"
...
...
@@ -1504,11 +1504,11 @@ msgstr "Articles"
msgid
"User has no account"
msgstr
"L'utilisateur n'a pas de compte"
#: core/templates/core/user_base.jinja:2
4
#: core/templates/core/user_base.jinja:2
6
msgid
"Stats"
msgstr
"Stats"
#: core/templates/core/user_base.jinja:
39
#: core/templates/core/user_base.jinja:
41
#: core/templates/core/user_tools.jinja:14
msgid
"Groups"
msgstr
"Groupes"
...
...
@@ -1621,7 +1621,7 @@ msgstr "Gestion de Sith"
msgid
"Subscriptions"
msgstr
"Cotisations"
#: core/templates/core/user_tools.jinja:22 counter/views.py:4
76
#: core/templates/core/user_tools.jinja:22 counter/views.py:4
81
msgid
"Counters"
msgstr
"Comptoirs"
...
...
@@ -1658,7 +1658,7 @@ msgstr "Ajouter un nouveau dossier"
msgid
"Error creating folder %(folder_name)s: %(msg)s"
msgstr
"Erreur de création du dossier %(folder_name)s : %(msg)s"
#: core/views/files.py:61 core/views/forms.py:17
0
core/views/forms.py:17
4
#: core/views/files.py:61 core/views/forms.py:17
1
core/views/forms.py:17
5
#, python-format
msgid
"Error uploading file %(file_name)s: %(msg)s"
msgstr
"Erreur d'envoie du fichier %(file_name)s : %(msg)s"
...
...
@@ -1671,11 +1671,11 @@ msgstr "Choisir un fichier"
msgid
"Choose user"
msgstr
"Choisir un utilisateur"
#: core/views/forms.py:8
7
#: core/views/forms.py:8
8
msgid
"Username, email, or account number"
msgstr
"Nom d'utilisateur, email, ou numéro de compte AE"
#: core/views/forms.py:1
29
#: core/views/forms.py:1
30
msgid
""
"Profile: you need to be visible on the picture, in order to be recognized (e."
"g. by the barmen)"
...
...
@@ -1683,15 +1683,15 @@ msgstr ""
"Photo de profil: vous devez être visible sur la photo afin d'être reconnu "
"(par exemple par les barmen)"
#: core/views/forms.py:13
0
#: core/views/forms.py:13
1
msgid
"Avatar: used on the forum"
msgstr
"Avatar : utilisé sur le forum"
#: core/views/forms.py:13
1
#: core/views/forms.py:13
2
msgid
"Scrub: let other know how your scrub looks like!"
msgstr
"Blouse : montrez aux autres à quoi ressemble votre blouse !"
#: core/views/forms.py:17
5
#: core/views/forms.py:17
6
msgid
"Bad image format, only jpeg, png, and gif are accepted"
msgstr
"Mauvais format d'image, seuls les jpeg, png, et gif sont acceptés"
...
...
@@ -1711,7 +1711,7 @@ msgstr "client"
msgid
"customers"
msgstr
"clients"
#: counter/models.py:44 counter/templates/counter/counter_click.jinja:4
3
#: counter/models.py:44 counter/templates/counter/counter_click.jinja:4
6
msgid
"Not enough money"
msgstr
"Solde insuffisant"
...
...
@@ -1877,30 +1877,34 @@ msgstr "Trop jeune pour ce produit"
msgid
"Not allowed for that product"
msgstr
"Non autorisé pour ce produit"
#: counter/templates/counter/counter_click.jinja:49
#: counter/templates/counter/counter_click.jinja:83
#: counter/templates/counter/counter_click.jinja:43
msgid
"No date of birth provided"
msgstr
"Pas de date de naissance renseigné"
#: counter/templates/counter/counter_click.jinja:52
#: counter/templates/counter/counter_click.jinja:86
#: launderette/templates/launderette/launderette_admin.jinja:35
#: launderette/templates/launderette/launderette_click.jinja:14
msgid
"Go"
msgstr
"Valider"
#: counter/templates/counter/counter_click.jinja:5
1
#: counter/templates/counter/counter_click.jinja:5
4
#: eboutic/templates/eboutic/eboutic_main.jinja:27
#: eboutic/templates/eboutic/eboutic_makecommand.jinja:11
msgid
"Basket: "
msgstr
"Panier : "
#: counter/templates/counter/counter_click.jinja:6
4
#: counter/templates/counter/counter_click.jinja:6
7
#: counter/templates/counter/counter_main.jinja:28
#: eboutic/templates/eboutic/eboutic_main.jinja:34
msgid
"Total: "
msgstr
"Total : "
#: counter/templates/counter/counter_click.jinja:
68
#: counter/templates/counter/counter_click.jinja:
71
msgid
"Finish"
msgstr
"Terminer"
#: counter/templates/counter/counter_click.jinja:
77
#: counter/templates/counter/counter_click.jinja:
80
msgid
"Refilling"
msgstr
"Rechargement"
...
...
@@ -2002,77 +2006,77 @@ msgstr "Mauvais identifiants"
msgid
"User is not subscriber"
msgstr
"L'utilisateur n'est pas cotisant."
#: counter/views.py:26
0
#: counter/views.py:26
5
msgid
"END"
msgstr
"FIN"
#: counter/views.py:26
2
#: counter/views.py:26
7
msgid
"CAN"
msgstr
"ANN"
#: counter/views.py:29
2
#: counter/views.py:29
7
msgid
"You have not enough money to buy all the basket"
msgstr
"Vous n'avez pas assez d'argent pour acheter le panier"
#: counter/views.py:47
3
#: counter/views.py:47
8
msgid
"Parent product"
msgstr
"Produit parent"
#: counter/views.py:47
4
#: counter/views.py:47
9
msgid
"Buying groups"
msgstr
"Groupes d'achat"
#: counter/views.py:54
1
#: counter/views.py:54
6
msgid
"10 cents"
msgstr
"10 centimes"
#: counter/views.py:54
2
#: counter/views.py:54
7
msgid
"20 cents"
msgstr
"20 centimes"
#: counter/views.py:54
3
#: counter/views.py:54
8
msgid
"50 cents"
msgstr
"50 centimes"
#: counter/views.py:54
4
#: counter/views.py:54
9
msgid
"1 euro"
msgstr
"1 €"
#: counter/views.py:5
4
5
#: counter/views.py:55
0
msgid
"2 euros"
msgstr
"2 €"
#: counter/views.py:5
46
#: counter/views.py:5
51
msgid
"5 euros"
msgstr
"5 €"
#: counter/views.py:5
47
#: counter/views.py:5
52
msgid
"10 euros"
msgstr
"10 €"
#: counter/views.py:5
48
#: counter/views.py:5
53
msgid
"20 euros"
msgstr
"20 €"
#: counter/views.py:54
9
#: counter/views.py:5
5
4
msgid
"50 euros"
msgstr
"50 €"
#: counter/views.py:55
0
#: counter/views.py:55
5
msgid
"100 euros"
msgstr
"100 €"
#: counter/views.py:55
1
counter/views.py:55
3
counter/views.py:5
55
#: counter/views.py:5
57
counter/views.py:5
59
#: counter/views.py:55
6
counter/views.py:55
8
counter/views.py:5
60
#: counter/views.py:5
62
counter/views.py:5
64
msgid
"Check amount"
msgstr
"Montant du chèque"
#: counter/views.py:55
2
counter/views.py:55
4
counter/views.py:5
5
6
#: counter/views.py:5
58
counter/views.py:56
0
#: counter/views.py:55
7
counter/views.py:55
9
counter/views.py:56
1
#: counter/views.py:5
63
counter/views.py:56
5
msgid
"Check quantity"
msgstr
"Nombre de chèque"
#: counter/views.py:56
2
#: counter/views.py:56
7
msgid
"Emptied"
msgstr
"Coffre vidé"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment