Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
AE
Sith
Commits
18c0809f
Commit
18c0809f
authored
Aug 28, 2020
by
Och
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sith: Added a new subscription
parent
5c8fa1b9
Pipeline
#2224
failed with stage
in 9 minutes and 28 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
149 additions
and
65 deletions
+149
-65
locale/fr/LC_MESSAGES/django.po
locale/fr/LC_MESSAGES/django.po
+84
-59
sith/settings.py
sith/settings.py
+5
-4
subscription/migrations/0013_auto_20200828_2117.py
subscription/migrations/0013_auto_20200828_2117.py
+46
-0
subscription/tests.py
subscription/tests.py
+14
-2
No files found.
locale/fr/LC_MESSAGES/django.po
View file @
18c0809f
...
...
@@ -21,7 +21,7 @@ msgstr ""
#: 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:13
4
#: stock/models.py:63 stock/models.py:105 stock/models.py:13
3
msgid
"name"
msgstr
"nom"
...
...
@@ -1158,7 +1158,7 @@ msgid "There are no members in this club."
msgstr
"Il n'y a pas de membres dans ce club."
#: club/templates/club/club_members.jinja:78
#: core/templates/core/file_detail.jinja:19 core/views/forms.py:33
7
#: core/templates/core/file_detail.jinja:19 core/views/forms.py:33
1
#: launderette/views.py:226 trombi/templates/trombi/detail.jinja:19
msgid
"Add"
msgstr
"Ajouter"
...
...
@@ -1366,8 +1366,13 @@ msgstr "Anciens membres"
msgid
"History"
msgstr
"Historique"
<<<<<<<
HEAD
#: club/views.py:115 core/templates/core/base.jinja:118 core/views/user.py:219
#: sas/templates/sas/picture.jinja:95 trombi/views.py:61
=======
#: club/views.py:125 core/templates/core/base.jinja:118 core/views/user.py:219
#: sas/templates/sas/picture.jinja:95 trombi/views.py:63
>>>>>>>
caf68dd
...
sith
:
Added
a
new
cotisation
msgid
"Tools"
msgstr
"Outils"
...
...
@@ -1438,7 +1443,7 @@ msgstr "contenu"
#: 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:13
8
#: stock/models.py:13
7
msgid
"type"
msgstr
"type"
...
...
@@ -3533,7 +3538,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:121 core/views/forms.py:
305
core/views/forms.py:3
12
#: core/views/files.py:121 core/views/forms.py:
299
core/views/forms.py:3
06
#: sas/views.py:94
#, python-format
msgid
"Error uploading file %(file_name)s: %(msg)s"
...
...
@@ -3615,19 +3620,19 @@ msgstr "Activer le plein écran"
msgid
"Markdown guide"
msgstr
"Guide markdown"
#: core/views/forms.py:1
2
1 core/views/forms.py:12
9
#: core/views/forms.py:11
9
core/views/forms.py:12
6
msgid
"Choose file"
msgstr
"Choisir un fichier"
#: core/views/forms.py:14
5
core/views/forms.py:1
53
#: core/views/forms.py:14
0
core/views/forms.py:1
47
msgid
"Choose user"
msgstr
"Choisir un utilisateur"
#: core/views/forms.py:1
85
#: core/views/forms.py:1
79
msgid
"Username, email, or account number"
msgstr
"Nom d'utilisateur, email, ou numéro de compte AE"
#: core/views/forms.py:25
1
#: core/views/forms.py:2
4
5
msgid
""
"Profile: you need to be visible on the picture, in order to be recognized (e."
"g. by the barmen)"
...
...
@@ -3635,36 +3640,40 @@ msgstr ""
"Photo de profil: vous devez être visible sur la photo afin d'être reconnu "
"(par exemple par les barmen)"
#: core/views/forms.py:2
53
#: core/views/forms.py:2
47
msgid
"Avatar: used on the forum"
msgstr
"Avatar : utilisé sur le forum"
#: core/views/forms.py:2
5
4
#: core/views/forms.py:24
8
msgid
"Scrub: let other know how your scrub looks like!"
msgstr
"Blouse : montrez aux autres à quoi ressemble votre blouse !"
#: core/views/forms.py:31
6
#: core/views/forms.py:31
0
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"
#: core/views/forms.py:33
6
#: core/views/forms.py:33
0
msgid
"Godfather"
msgstr
"Parrain"
#: core/views/forms.py:33
6
#: core/views/forms.py:33
0
msgid
"Godchild"
msgstr
"Fillot"
<<<<<<<
HEAD
#: core/views/forms.py:340 counter/views.py:154 trombi/views.py:156
=======
#: core/views/forms.py:334 counter/views.py:154 trombi/views.py:158
>>>>>>>
caf68dd
...
sith
:
Added
a
new
cotisation
msgid
"Select user"
msgstr
"Choisir un utilisateur"
#: core/views/forms.py:3
53
core/views/forms.py:3
71
election/models.py:24
#: core/views/forms.py:3
47
core/views/forms.py:3
65
election/models.py:24
#: election/views.py:154
msgid
"edit groups"
msgstr
"groupe d'édition"
#: core/views/forms.py:35
6
core/views/forms.py:3
74
election/models.py:31
#: core/views/forms.py:35
0
core/views/forms.py:3
68
election/models.py:31
#: election/views.py:157
msgid
"view groups"
msgstr
"groupe de vue"
...
...
@@ -4753,12 +4762,20 @@ msgid "Washing and drying"
msgstr
"Lavage et séchage"
#: launderette/templates/launderette/launderette_book.jinja:27
<<<<<<<
HEAD
#: sith/settings.py:592
=======
#: sith/settings.py:594
>>>>>>>
caf68dd
...
sith
:
Added
a
new
cotisation
msgid
"Washing"
msgstr
"Lavage"
#: launderette/templates/launderette/launderette_book.jinja:31
<<<<<<<
HEAD
#: sith/settings.py:592
=======
#: sith/settings.py:594
>>>>>>>
caf68dd
...
sith
:
Added
a
new
cotisation
msgid
"Drying"
msgstr
"Séchage"
...
...
@@ -5430,19 +5447,19 @@ msgstr "Suppression de rechargement"
#: sith/settings.py:480
msgid
"One semester"
msgstr
"Un semestre,
15
€"
msgstr
"Un semestre,
20
€"
#: sith/settings.py:481
msgid
"Two semesters"
msgstr
"Deux semestres,
28
€"
msgstr
"Deux semestres,
35
€"
#: sith/settings.py:483
msgid
"Common core cursus"
msgstr
"Cursus tronc commun,
45
€"
msgstr
"Cursus tronc commun,
60
€"
#: sith/settings.py:487
msgid
"Branch cursus"
msgstr
"Cursus branche,
45
€"
msgstr
"Cursus branche,
60
€"
#: sith/settings.py:488
msgid
"Alternating cursus"
...
...
@@ -5470,150 +5487,158 @@ msgstr "Membres du CROUS, 0 €"
#: sith/settings.py:494
msgid
"Sbarro/ESTA member"
msgstr
"Membre de Sbarro ou de l'ESTA,
15
€"
msgstr
"Membre de Sbarro ou de l'ESTA,
20
€"
#: sith/settings.py:496
msgid
"One semester Welcome Week"
msgstr
"Un semestre Welcome Week"
#: sith/settings.py:500
msgid
"One month for free"
msgstr
"Un mois gratuit"
#: sith/settings.py:501
msgid
"Two months for free"
msgstr
"Deux mois gratuits"
#: sith/settings.py:50
1
msgid
"Eurok's volunteer"
#: sith/settings.py:50
2
msgid
"Euro
c
k's volunteer"
msgstr
"Bénévole Eurockéennes"
#: sith/settings.py:50
3
#: sith/settings.py:50
4
msgid
"Six weeks for free"
msgstr
"6 semaines gratuites"
#: sith/settings.py:50
7
#: sith/settings.py:50
8
msgid
"One day"
msgstr
"Un jour"
#: sith/settings.py:510
#: sith/settings.py:509
msgid
"GA staff member"
msgstr
"Membre staff GA (2 semaines), 1 €"
#: sith/settings.py:512
msgid
"One semester (-20%)"
msgstr
"Un semestre (-20%), 12 €"
#: sith/settings.py:51
5
#: sith/settings.py:51
7
msgid
"Two semesters (-20%)"
msgstr
"Deux semestres (-20%), 22 €"
#: sith/settings.py:52
0
#: sith/settings.py:52
2
msgid
"Common core cursus (-20%)"
msgstr
"Cursus tronc commun (-20%), 36 €"
#: sith/settings.py:52
5
#: sith/settings.py:52
7
msgid
"Branch cursus (-20%)"
msgstr
"Cursus branche (-20%), 36 €"
#: sith/settings.py:53
0
#: sith/settings.py:53
2
msgid
"Alternating cursus (-20%)"
msgstr
"Cursus alternant (-20%), 24 €"
#: sith/settings.py:55
2
#: sith/settings.py:55
4
msgid
"President"
msgstr
"Président"
#: sith/settings.py:55
3
#: sith/settings.py:55
5
msgid
"Vice-President"
msgstr
"Vice-Président"
#: sith/settings.py:55
4
#: sith/settings.py:55
6
msgid
"Treasurer"
msgstr
"Trésorier"
#: sith/settings.py:55
5
#: sith/settings.py:55
7
msgid
"Communication supervisor"
msgstr
"Responsable communication"
#: sith/settings.py:55
6
#: sith/settings.py:55
8
msgid
"Secretary"
msgstr
"Secrétaire"
#: sith/settings.py:55
7
#: sith/settings.py:55
9
msgid
"IT supervisor"
msgstr
"Responsable info"
#: sith/settings.py:5
58
#: sith/settings.py:5
60
msgid
"Board member"
msgstr
"Membre du bureau"
#: sith/settings.py:5
59
#: sith/settings.py:5
61
msgid
"Active member"
msgstr
"Membre actif"
#: sith/settings.py:56
0
#: sith/settings.py:56
2
msgid
"Curious"
msgstr
"Curieux"
#: sith/settings.py:59
6
#: sith/settings.py:59
8
msgid
"A new poster needs to be moderated"
msgstr
"Une nouvelle affiche a besoin d'être modérée"
#: sith/settings.py:59
7
#: sith/settings.py:59
9
msgid
"A new mailing list needs to be moderated"
msgstr
"Une nouvelle mailing list a besoin d'être modérée"
#: sith/settings.py:60
0
#: sith/settings.py:60
2
msgid
"A new pedagogy comment has been signaled for moderation"
msgstr
""
"Un nouveau commentaire de la pédagogie a été signalé pour la modération"
#: sith/settings.py:60
2
#: sith/settings.py:60
4
#, python-format
msgid
"There are %s fresh news to be moderated"
msgstr
"Il y a %s nouvelles toutes fraîches à modérer"
#: sith/settings.py:60
3
#: sith/settings.py:60
5
msgid
"New files to be moderated"
msgstr
"Nouveaux fichiers à modérer"
#: sith/settings.py:60
4
#: sith/settings.py:60
6
#, python-format
msgid
"There are %s pictures to be moderated in the SAS"
msgstr
"Il y a %s photos à modérer dans le SAS"
#: sith/settings.py:60
5
#: sith/settings.py:60
7
msgid
"You've been identified on some pictures"
msgstr
"Vous avez été identifié sur des photos"
#: sith/settings.py:60
6
#: sith/settings.py:60
8
#, python-format
msgid
"You just refilled of %s €"
msgstr
"Vous avez rechargé votre compte de %s€"
#: sith/settings.py:60
7
#: sith/settings.py:60
9
#, python-format
msgid
"You just bought %s"
msgstr
"Vous avez acheté %s"
#: sith/settings.py:60
8
#: sith/settings.py:6
1
0
msgid
"You have a notification"
msgstr
"Vous avez une notification"
#: sith/settings.py:62
0
#: sith/settings.py:62
2
msgid
"Success!"
msgstr
"Succès !"
#: sith/settings.py:62
1
#: sith/settings.py:62
3
msgid
"Fail!"
msgstr
"Échec !"
#: sith/settings.py:62
2
#: sith/settings.py:62
4
msgid
"You successfully posted an article in the Weekmail"
msgstr
"Article posté avec succès dans le Weekmail"
#: sith/settings.py:62
3
#: sith/settings.py:62
5
msgid
"You successfully edited an article in the Weekmail"
msgstr
"Article édité avec succès dans le Weekmail"
#: sith/settings.py:62
4
#: sith/settings.py:62
6
msgid
"You successfully sent the Weekmail"
msgstr
"Weekmail envoyé avec succès"
#: sith/settings.py:63
2
#: sith/settings.py:63
4
msgid
"AE tee-shirt"
msgstr
"Tee-shirt AE"
...
...
@@ -5649,23 +5674,23 @@ msgstr ""
msgid
"todo"
msgstr
"à faire"
#: stock/models.py:12
8
#: stock/models.py:12
7
msgid
"shopping lists"
msgstr
"listes de courses"
#: stock/models.py:14
4
#: stock/models.py:14
3
msgid
"quantity to buy"
msgstr
"quantité à acheter"
#: stock/models.py:14
6
#: stock/models.py:14
5
msgid
"quantity to buy during the next shopping session"
msgstr
"quantité à acheter pendant les prochaines courses"
#: stock/models.py:14
9
#: stock/models.py:14
8
msgid
"quantity bought"
msgstr
"quantité achetée"
#: stock/models.py:15
1
#: stock/models.py:15
0
msgid
"quantity bought during the last shopping session"
msgstr
"quantité achetée pendant les dernières courses"
...
...
sith/settings.py
View file @
18c0809f
...
...
@@ -477,14 +477,14 @@ SITH_SUBSCRIPTION_END = 10
# Subscription durations are in semestres
# Be careful, modifying this parameter will need a migration to be applied
SITH_SUBSCRIPTIONS
=
{
"un-semestre"
:
{
"name"
:
_
(
"One semester"
),
"price"
:
15
,
"duration"
:
1
},
"deux-semestres"
:
{
"name"
:
_
(
"Two semesters"
),
"price"
:
28
,
"duration"
:
2
},
"un-semestre"
:
{
"name"
:
_
(
"One semester"
),
"price"
:
20
,
"duration"
:
1
},
"deux-semestres"
:
{
"name"
:
_
(
"Two semesters"
),
"price"
:
35
,
"duration"
:
2
},
"cursus-tronc-commun"
:
{
"name"
:
_
(
"Common core cursus"
),
"price"
:
45
,
"price"
:
60
,
"duration"
:
4
,
},
"cursus-branche"
:
{
"name"
:
_
(
"Branch cursus"
),
"price"
:
45
,
"duration"
:
6
},
"cursus-branche"
:
{
"name"
:
_
(
"Branch cursus"
),
"price"
:
60
,
"duration"
:
6
},
"cursus-alternant"
:
{
"name"
:
_
(
"Alternating cursus"
),
"price"
:
30
,
"duration"
:
6
},
"membre-honoraire"
:
{
"name"
:
_
(
"Honorary member"
),
"price"
:
0
,
"duration"
:
666
},
"assidu"
:
{
"name"
:
_
(
"Assidu member"
),
"price"
:
0
,
"duration"
:
2
},
...
...
@@ -497,6 +497,7 @@ SITH_SUBSCRIPTIONS = {
"price"
:
0
,
"duration"
:
1
,
},
"un-mois-essai"
:
{
"name"
:
_
(
"One month for free"
),
"price"
:
0
,
"duration"
:
0.166
},
"deux-mois-essai"
:
{
"name"
:
_
(
"Two months for free"
),
"price"
:
0
,
"duration"
:
0.33
},
"benevoles-euroks"
:
{
"name"
:
_
(
"Eurok's volunteer"
),
"price"
:
5
,
"duration"
:
0.1
},
"six-semaines-essai"
:
{
...
...
subscription/migrations/0013_auto_20200828_2117.py
0 → 100644
View file @
18c0809f
# Generated by Django 2.2.13 on 2020-08-28 19:17
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
"subscription"
,
"0012_auto_20200615_1438"
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
"subscription"
,
name
=
"subscription_type"
,
field
=
models
.
CharField
(
choices
=
[
(
"amicale/doceo"
,
"Amicale/DOCEO member"
),
(
"assidu"
,
"Assidu member"
),
(
"benevoles-euroks"
,
"Eurok's volunteer"
),
(
"crous"
,
"CROUS member"
),
(
"cursus-alternant"
,
"Alternating cursus"
),
(
"cursus-alternant-reduction"
,
"Alternating cursus (-20%)"
),
(
"cursus-branche"
,
"Branch cursus"
),
(
"cursus-branche-reduction"
,
"Branch cursus (-20%)"
),
(
"cursus-tronc-commun"
,
"Common core cursus"
),
(
"cursus-tronc-commun-reduction"
,
"Common core cursus (-20%)"
),
(
"deux-mois-essai"
,
"Two months for free"
),
(
"deux-semestres"
,
"Two semesters"
),
(
"deux-semestres-reduction"
,
"Two semesters (-20%)"
),
(
"membre-honoraire"
,
"Honorary member"
),
(
"membre-staff-ga"
,
"GA staff member"
),
(
"reseau-ut"
,
"UT network member"
),
(
"sbarro/esta"
,
"Sbarro/ESTA member"
),
(
"six-semaines-essai"
,
"Six weeks for free"
),
(
"un-jour"
,
"One day"
),
(
"un-mois-essai"
,
"One month for free"
),
(
"un-semestre"
,
"One semester"
),
(
"un-semestre-reduction"
,
"One semester (-20%)"
),
(
"un-semestre-welcome"
,
"One semester Welcome Week"
),
],
max_length
=
255
,
verbose_name
=
"subscription type"
,
),
),
]
subscription/tests.py
View file @
18c0809f
...
...
@@ -114,6 +114,18 @@ class SubscriptionIntegrationTest(TestCase):
call_command
(
"populate"
)
self
.
user
=
User
.
objects
.
filter
(
username
=
"public"
).
first
()
def
test_duration_one_month
(
self
):
s
=
Subscription
(
member
=
User
.
objects
.
filter
(
pk
=
self
.
user
.
pk
).
first
(),
subscription_type
=
list
(
settings
.
SITH_SUBSCRIPTIONS
.
keys
())[
3
],
payment_method
=
settings
.
SITH_SUBSCRIPTION_PAYMENT_METHOD
[
0
],
)
s
.
subscription_start
=
date
(
2017
,
8
,
29
)
s
.
subscription_end
=
s
.
compute_end
(
duration
=
0.166
,
start
=
s
.
subscription_start
)
s
.
save
()
self
.
assertTrue
(
s
.
subscription_end
==
date
(
2017
,
9
,
29
))
def
test_duration_two_months
(
self
):
s
=
Subscription
(
...
...
@@ -122,11 +134,11 @@ class SubscriptionIntegrationTest(TestCase):
payment_method
=
settings
.
SITH_SUBSCRIPTION_PAYMENT_METHOD
[
0
],
)
s
.
subscription_start
=
date
(
2017
,
8
,
29
)
s
.
subscription_end
=
s
.
compute_end
(
duration
=
0.
33
,
start
=
s
.
subscription_start
)
s
.
subscription_end
=
s
.
compute_end
(
duration
=
0.
166
,
start
=
s
.
subscription_start
)
s
.
save
()
self
.
assertTrue
(
s
.
subscription_end
==
date
(
2017
,
10
,
29
))
def
test_duration_
two_months
(
self
):
def
test_duration_
one_day
(
self
):
s
=
Subscription
(
member
=
User
.
objects
.
filter
(
pk
=
self
.
user
.
pk
).
first
(),
...
...
Write
Preview
Markdown
is supported
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