Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
AE
Sith
Commits
f2c3c7dc
Commit
f2c3c7dc
authored
Aug 22, 2016
by
Skia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add viewable flag for user
parent
eef5dfd2
Pipeline
#136
failed with stage
in 2 minutes and 14 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
129 additions
and
94 deletions
+129
-94
core/migrations/0008_user_is_subscriber_viewable.py
core/migrations/0008_user_is_subscriber_viewable.py
+19
-0
core/models.py
core/models.py
+4
-0
core/views/forms.py
core/views/forms.py
+1
-1
locale/fr/LC_MESSAGES/django.mo
locale/fr/LC_MESSAGES/django.mo
+0
-0
locale/fr/LC_MESSAGES/django.po
locale/fr/LC_MESSAGES/django.po
+88
-76
migrate.py
migrate.py
+17
-17
No files found.
core/migrations/0008_user_is_subscriber_viewable.py
0 → 100644
View file @
f2c3c7dc
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'core'
,
'0007_auto_20160813_0522'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'user'
,
name
=
'is_subscriber_viewable'
,
field
=
models
.
BooleanField
(
default
=
True
,
verbose_name
=
'is subscriber viewable'
),
),
]
core/models.py
View file @
f2c3c7dc
...
...
@@ -167,6 +167,7 @@ class User(AbstractBaseUser):
parent_phone
=
PhoneNumberField
(
_
(
"parent phone"
),
null
=
True
,
blank
=
True
)
address
=
models
.
CharField
(
_
(
"address"
),
max_length
=
128
,
blank
=
True
,
default
=
""
)
parent_address
=
models
.
CharField
(
_
(
"parent address"
),
max_length
=
128
,
blank
=
True
,
default
=
""
)
is_subscriber_viewable
=
models
.
BooleanField
(
_
(
"is subscriber viewable"
),
default
=
True
)
objects
=
UserManager
()
...
...
@@ -359,6 +360,9 @@ class User(AbstractBaseUser):
def
can_be_edited_by
(
self
,
user
):
return
user
.
is_in_group
(
settings
.
SITH_MAIN_BOARD_GROUP
)
or
user
.
is_root
def
can_be_viewed_by
(
self
,
user
):
return
(
user
.
is_in_group
(
settings
.
SITH_MAIN_MEMBERS_GROUP
)
and
self
.
is_subscriber_viewable
)
or
user
.
is_root
def
get_mini_item
(
self
):
return
"""
<div class="mini_profile_link" >
...
...
core/views/forms.py
View file @
f2c3c7dc
...
...
@@ -98,7 +98,7 @@ class UserProfileForm(forms.ModelForm):
fields
=
[
'first_name'
,
'last_name'
,
'nick_name'
,
'email'
,
'date_of_birth'
,
'profile_pict'
,
'avatar_pict'
,
'scrub_pict'
,
'sex'
,
'second_email'
,
'address'
,
'parent_address'
,
'phone'
,
'parent_phone'
,
'tshirt_size'
,
'role'
,
'department'
,
'dpt_option'
,
'semester'
,
'quote'
,
'school'
,
'promo'
,
'forum_signature'
]
'forum_signature'
,
'is_subscriber_viewable'
]
widgets
=
{
'date_of_birth'
:
SelectDate
,
'profile_pict'
:
forms
.
ClearableFileInput
,
...
...
locale/fr/LC_MESSAGES/django.mo
View file @
f2c3c7dc
No preview for this file type
locale/fr/LC_MESSAGES/django.po
View file @
f2c3c7dc
...
...
@@ -6,7 +6,7 @@
msgid
""
msgstr
""
"Report-Msgid-Bugs-To:
\n
"
"POT-Creation-Date: 2016-08-2
0 21
:1
1
+0200
\n
"
"POT-Creation-Date: 2016-08-2
2 18
:1
3
+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
"
...
...
@@ -66,7 +66,7 @@ msgstr "montant effectif"
msgid
"number"
msgstr
"numéro"
#: accounting/models.py:154 core/models.py:4
26
core/models.py:70
2
#: accounting/models.py:154 core/models.py:4
30
core/models.py:70
6
#: counter/models.py:215 counter/models.py:261 eboutic/models.py:14
#: eboutic/models.py:47
msgid
"date"
...
...
@@ -218,6 +218,7 @@ msgstr "Éditer"
#: accounting/templates/accounting/bank_account_list.jinja:16
#: core/templates/core/file_detail.jinja:43
#: core/templates/core/group_list.jinja:13
#: core/templates/core/user_edit.jinja:18
#: launderette/templates/launderette/launderette_admin.jinja:16
#: launderette/views.py:146
msgid
"Delete"
...
...
@@ -767,120 +768,124 @@ msgstr "téléphone des parents"
msgid
"parent address"
msgstr
"adresse des parents"
#: core/models.py:256
#: core/models.py:170
msgid
"is subscriber viewable"
msgstr
"profil visible par les cotisants"
#: core/models.py:257
msgid
"A user with that username already exists"
msgstr
"Un utilisateur de ce nom d'utilisateur existe déjà"
#: core/models.py:37
2
core/templates/core/macros.jinja:17
#: core/models.py:37
6
core/templates/core/macros.jinja:17
#: core/templates/core/user_detail.jinja:14
#: core/templates/core/user_detail.jinja:16
#: core/templates/core/user_edit.jinja:1
5
#: core/templates/core/user_edit.jinja:1
6
msgid
"Profile"
msgstr
"Profil"
#: core/models.py:40
3
#: core/models.py:40
7
msgid
"Visitor"
msgstr
"Visiteur"
#: core/models.py:4
08
#: core/models.py:4
12
msgid
"define if we show a users stats"
msgstr
"Definit si l'on montre les statistiques de l'utilisateur"
#: core/models.py:41
0
#: core/models.py:41
4
msgid
"Show your account statistics to others"
msgstr
"Montrez vos statistiques de compte aux autres"
#: core/models.py:41
7
#: core/models.py:4
2
1
msgid
"file name"
msgstr
"nom du fichier"
#: core/models.py:4
18
core/models.py:55
1
#: core/models.py:4
22
core/models.py:55
5
msgid
"parent"
msgstr
"parent"
#: core/models.py:4
19
core/models.py:4
29
#: core/models.py:4
23
core/models.py:4
33
msgid
"file"
msgstr
"fichier"
#: core/models.py:42
0
#: core/models.py:42
4
msgid
"owner"
msgstr
"propriétaire"
#: core/models.py:42
1
core/models.py:5
57
#: core/models.py:42
5
core/models.py:5
61
msgid
"edit group"
msgstr
"groupe d'édition"
#: core/models.py:42
2
core/models.py:5
58
#: core/models.py:42
6
core/models.py:5
62
msgid
"view group"
msgstr
"groupe de vue"
#: core/models.py:42
3
#: core/models.py:42
7
msgid
"is folder"
msgstr
"est un dossier"
#: core/models.py:42
4
#: core/models.py:42
8
msgid
"mime type"
msgstr
"type mime"
#: core/models.py:42
5
#: core/models.py:42
9
msgid
"size"
msgstr
"taille"
#: core/models.py:45
5
#: core/models.py:45
9
msgid
"Character '/' not authorized in name"
msgstr
"Le caractère '/' n'est pas autorisé dans les noms de fichier"
#: core/models.py:4
58
core/models.py:46
3
#: core/models.py:4
62
core/models.py:46
7
msgid
"Loop in folder tree"
msgstr
"Boucle dans l'arborescence des dossiers"
#: core/models.py:4
6
7
#: core/models.py:47
1
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:47
1
#: core/models.py:47
5
msgid
"Duplicate file"
msgstr
"Un fichier de ce nom existe déjà"
#: core/models.py:48
1
#: core/models.py:48
5
msgid
"You must provide a file"
msgstr
"Vous devez fournir un fichier"
#: core/models.py:50
6
#: core/models.py:5
1
0
msgid
"Folder: "
msgstr
"Dossier : "
#: core/models.py:5
08
#: core/models.py:5
12
msgid
"File: "
msgstr
"Fichier : "
#: core/models.py:55
0
core/models.py:55
4
#: core/models.py:55
4
core/models.py:55
8
msgid
"page name"
msgstr
"nom de la page"
#: core/models.py:55
5
#: core/models.py:55
9
msgid
"owner group"
msgstr
"groupe propriétaire"
#: core/models.py:5
86
#: core/models.py:5
90
msgid
"Duplicate page"
msgstr
"Une page de ce nom existe déjà"
#: core/models.py:59
2
#: core/models.py:59
6
msgid
"Loop in page tree"
msgstr
"Boucle dans l'arborescence des pages"
#: core/models.py:
699
#: core/models.py:
703
msgid
"revision"
msgstr
"révision"
#: core/models.py:70
0
#: core/models.py:70
4
msgid
"page title"
msgstr
"titre de la page"
#: core/models.py:70
1
#: core/models.py:70
5
msgid
"page content"
msgstr
"contenu de la page"
...
...
@@ -970,7 +975,7 @@ msgstr "Confirmation"
#: core/templates/core/delete_confirm.jinja:14
#: core/templates/core/file_delete_confirm.jinja:14
#: counter/templates/counter/counter_click.jinja:
8
3
#: counter/templates/counter/counter_click.jinja:
7
3
msgid
"Cancel"
msgstr
"Annuler"
...
...
@@ -1039,7 +1044,7 @@ msgid "Edit group"
msgstr
"Éditer le groupe"
#: core/templates/core/group_edit.jinja:9
#: core/templates/core/user_edit.jinja:
24
#: core/templates/core/user_edit.jinja:
36
#: core/templates/core/user_group.jinja:8
msgid
"Update"
msgstr
"Mettre à jour"
...
...
@@ -1347,35 +1352,39 @@ msgstr "Éditer le profil de l'utilisateur"
msgid
"Current profile: "
msgstr
"Profil actuel : "
#: core/templates/core/user_edit.jinja:17
#: core/templates/core/user_edit.jinja:24
msgid
"Take picture"
msgstr
""
#: core/templates/core/user_edit.jinja:29
msgid
"Current avatar: "
msgstr
"Avatar actuel : "
#: core/templates/core/user_edit.jinja:
18
#: core/templates/core/user_edit.jinja:
30
msgid
"Avatar"
msgstr
"Avatar"
#: core/templates/core/user_edit.jinja:2
0
#: core/templates/core/user_edit.jinja:
3
2
msgid
"Current scrub: "
msgstr
"Blouse actuelle : "
#: core/templates/core/user_edit.jinja:
21
#: core/templates/core/user_edit.jinja:
33
msgid
"Scrub"
msgstr
"Blouse"
#: core/templates/core/user_edit.jinja:
25
#: core/templates/core/user_edit.jinja:
37
msgid
"Username: "
msgstr
"Nom d'utilisateur : "
#: core/templates/core/user_edit.jinja:
27
#: core/templates/core/user_edit.jinja:
39
msgid
"Account number: "
msgstr
"Numero de compte : "
#: core/templates/core/user_edit.jinja:
30
#: core/templates/core/user_edit.jinja:
42
msgid
"Change my password"
msgstr
"Changer mon mot de passe"
#: core/templates/core/user_edit.jinja:
32
#: core/templates/core/user_edit.jinja:
44
msgid
"Change user password"
msgstr
"Changer le mot de passe"
...
...
@@ -1414,7 +1423,7 @@ msgstr "Gestion de Sith"
msgid
"Subscriptions"
msgstr
"Cotisations"
#: core/templates/core/user_tools.jinja:22 counter/views.py:4
68
#: core/templates/core/user_tools.jinja:22 counter/views.py:4
70
msgid
"Counters"
msgstr
"Comptoirs"
...
...
@@ -1451,7 +1460,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:6
2
core/views/forms.py:1
68
core/views/forms.py:1
72
#: core/views/files.py:6
1
core/views/forms.py:1
52
core/views/forms.py:1
56
#, python-format
msgid
"Error uploading file %(file_name)s: %(msg)s"
msgstr
"Erreur d'envoie du fichier %(file_name)s : %(msg)s"
...
...
@@ -1464,7 +1473,7 @@ msgstr "Choisir un fichier"
msgid
"Choose user"
msgstr
"Choisir un utilisateur"
#: core/views/forms.py:1
27
#: core/views/forms.py:1
11
msgid
""
"Profile: you need to be visible on the picture, in order to be recognized (e."
"g. by the barmen)"
...
...
@@ -1472,18 +1481,22 @@ msgstr ""
"Photo de profil: vous devez être visible sur la photo afin d'être reconnu "
"(par exemple par les barmen)"
#: core/views/forms.py:12
8
#: core/views/forms.py:1
1
2
msgid
"Avatar: used on the forum"
msgstr
"Avatar : utilisé sur le forum"
#: core/views/forms.py:1
29
#: core/views/forms.py:1
13
msgid
"Scrub: let other know how your scrub looks like!"
msgstr
"Blouse : montrez aux autres à quoi ressemble votre blouse !"
#: core/views/forms.py:17
3
#: core/views/forms.py:1
5
7
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/user.py:178
msgid
"User already has a profile picture"
msgstr
""
#: counter/models.py:24
msgid
"account id"
msgstr
"numéro de compte"
...
...
@@ -1496,7 +1509,7 @@ msgstr "client"
msgid
"customers"
msgstr
"clients"
#: counter/models.py:44 counter/templates/counter/counter_click.jinja:
5
3
#: counter/models.py:44 counter/templates/counter/counter_click.jinja:
4
3
msgid
"Not enough money"
msgstr
"Solde insuffisant"
...
...
@@ -1610,49 +1623,45 @@ msgstr "permanence"
msgid
"Customer"
msgstr
"Client"
#: counter/templates/counter/counter_click.jinja:35
msgid
"Refilling"
msgstr
"Rechargement"
#: counter/templates/counter/counter_click.jinja:40
#: counter/templates/counter/counter_click.jinja:59
#: launderette/templates/launderette/launderette_admin.jinja:35
#: launderette/templates/launderette/launderette_click.jinja:14
msgid
"Go"
msgstr
"Valider"
#: counter/templates/counter/counter_click.jinja:45
#: counter/templates/counter/counter_click.jinja:34
#: launderette/templates/launderette/launderette_admin.jinja:8
msgid
"Selling"
msgstr
"Vente"
#: counter/templates/counter/counter_click.jinja:
4
7
#: counter/templates/counter/counter_click.jinja:
3
7
msgid
"Too young for that product"
msgstr
"Trop jeune pour ce produit"
#: counter/templates/counter/counter_click.jinja:
5
0
#: counter/templates/counter/counter_click.jinja:
4
0
msgid
"Not allowed for that product"
msgstr
"Non autorisé pour ce produit"
#: counter/templates/counter/counter_click.jinja:61
#: counter/templates/counter/counter_click.jinja:49
#: counter/templates/counter/counter_click.jinja:83
#: launderette/templates/launderette/launderette_admin.jinja:35
#: launderette/templates/launderette/launderette_click.jinja:14
msgid
"Go"
msgstr
"Valider"
#: counter/templates/counter/counter_click.jinja:51
#: eboutic/templates/eboutic/eboutic_main.jinja:27
#: eboutic/templates/eboutic/eboutic_makecommand.jinja:11
msgid
"Basket: "
msgstr
"Panier : "
#: counter/templates/counter/counter_click.jinja:
7
4
#: counter/templates/counter/counter_click.jinja:
6
4
#: counter/templates/counter/counter_main.jinja:28
#: eboutic/templates/eboutic/eboutic_main.jinja:34
msgid
"Total: "
msgstr
"Total : "
#: counter/templates/counter/counter_click.jinja:
7
8
#: counter/templates/counter/counter_click.jinja:
6
8
msgid
"Finish"
msgstr
"Terminer"
#: counter/templates/counter/counter_click.jinja:
85
msgid
"
Products:
"
msgstr
"
Produits :
"
#: counter/templates/counter/counter_click.jinja:
77
msgid
"
Refilling
"
msgstr
"
Rechargement
"
#: counter/templates/counter/counter_list.jinja:4
#: counter/templates/counter/counter_list.jinja:10
...
...
@@ -1752,23 +1761,23 @@ msgstr "Mauvais identifiants"
msgid
"User is not subscriber"
msgstr
"L'utilisateur n'est pas cotisant."
#: counter/views.py:25
3
#: counter/views.py:25
7
msgid
"END"
msgstr
"FIN"
#: counter/views.py:25
5
#: counter/views.py:25
9
msgid
"CAN"
msgstr
"ANN"
#: counter/views.py:28
5
#: counter/views.py:28
9
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:46
5
#: counter/views.py:46
7
msgid
"Parent product"
msgstr
"Produit parent"
#: counter/views.py:46
6
#: counter/views.py:46
8
msgid
"Buying groups"
msgstr
"Groupes d'achat"
...
...
@@ -1831,7 +1840,7 @@ msgstr "Le paiement a été effectué"
msgid
"Return to eboutic"
msgstr
"Retourner à l'eboutic"
#: eboutic/views.py:13
6
#: eboutic/views.py:13
8
msgid
"You do not have enough money to buy the basket"
msgstr
"Vous n'avez pas assez d'argent pour acheter le panier"
...
...
@@ -2117,14 +2126,17 @@ msgstr "Vous ne pouvez pas cotiser plusieurs fois pour la même période"
msgid
"You are trying to create a subscription without member"
msgstr
"Vous essayez de créer une cotisation sans membre"
#: subscription/views.py:5
2
#: subscription/views.py:5
1
msgid
"A user with that email address already exists"
msgstr
"Un utilisateur avec cette adresse email existe déjà"
#: subscription/views.py:6
7
#: subscription/views.py:6
6
msgid
"You must either choose an existing user or create a new one properly"
msgstr
""
"Vous devez soit choisir un utilisateur existant, ou en créer un proprement."
#~ msgid "Products: "
#~ msgstr "Produits : "
#~ msgid "Club: "
#~ msgstr "Club : "
migrate.py
View file @
f2c3c7dc
...
...
@@ -132,6 +132,7 @@ def migrate_users():
parent_address
=
(
to_unicode
(
u
[
'adresse_parents'
])
+
", "
+
to_unicode
(
u
[
'cpostal_parents'
])
+
" "
+
to_unicode
(
u
[
'ville_parents'
])),
phone
=
u
[
'tel_portable_utl'
]
or
""
,
parent_phone
=
u
[
'tel_parents'
]
or
""
,
is_subscriber_viewable
=
bool
(
u
[
'publique_utl'
]),
)
new
.
generate_username
()
new
.
save
()
...
...
@@ -602,24 +603,23 @@ def migrate_permanencies():
cur
.
close
()
def
main
():
#
migrate_users()
#
migrate_profile_pict()
#
migrate_clubs()
#
migrate_club_memberships()
#
migrate_subscriptions()
#
update_customer_account()
#
migrate_counters()
#
migrate_permanencies()
#
migrate_typeproducts()
#
migrate_products()
#
migrate_product_pict()
#
migrate_products_to_counter()
migrate_users
()
migrate_profile_pict
()
migrate_clubs
()
migrate_club_memberships
()
migrate_subscriptions
()
update_customer_account
()
migrate_counters
()
migrate_permanencies
()
migrate_typeproducts
()
migrate_products
()
migrate_product_pict
()
migrate_products_to_counter
()
# reset_customer_amount()
# migrate_invoices()
# migrate_refillings()
# migrate_sellings()
reset_index
(
'core'
)
# reset_index('core', 'club', 'subscription', 'accounting', 'eboutic', 'launderette', 'counter')
migrate_invoices
()
migrate_refillings
()
migrate_sellings
()
reset_index
(
'core'
,
'club'
,
'subscription'
,
'accounting'
,
'eboutic'
,
'launderette'
,
'counter'
)
if
__name__
==
"__main__"
:
main
()
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