1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-11-26 18:37:12 +00:00

Compare commits

..

No commits in common. "cbd36f110af81dea4f1222190cfa8f8bb4bb7d88" and "d455c5c53372e517957c0c167c08eb31a2273220" have entirely different histories.

17 changed files with 174 additions and 357 deletions

View File

@ -5,7 +5,6 @@ from django.contrib import admin
from django.contrib.auth.admin import UserAdmin from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User from django.contrib.auth.models import User
from note_kfet.admin import admin_site
from .forms import ProfileForm from .forms import ProfileForm
from .models import Club, Membership, Profile from .models import Club, Membership, Profile
@ -34,8 +33,9 @@ class CustomUserAdmin(UserAdmin):
# Update Django User with profile # Update Django User with profile
admin_site.register(User, CustomUserAdmin) admin.site.unregister(User)
admin.site.register(User, CustomUserAdmin)
# Add other models # Add other models
admin_site.register(Club) admin.site.register(Club)
admin_site.register(Membership) admin.site.register(Membership)

View File

@ -6,8 +6,6 @@ from django.utils.translation import gettext_lazy as _
from polymorphic.admin import PolymorphicChildModelAdmin, \ from polymorphic.admin import PolymorphicChildModelAdmin, \
PolymorphicChildModelFilter, PolymorphicParentModelAdmin PolymorphicChildModelFilter, PolymorphicParentModelAdmin
from note_kfet.admin import admin_site
from .models.notes import Alias, Note, NoteClub, NoteSpecial, NoteUser from .models.notes import Alias, Note, NoteClub, NoteSpecial, NoteUser
from .models.transactions import Transaction, TemplateCategory, TransactionTemplate, \ from .models.transactions import Transaction, TemplateCategory, TransactionTemplate, \
RecurrentTransaction, MembershipTransaction, SpecialTransaction RecurrentTransaction, MembershipTransaction, SpecialTransaction
@ -21,7 +19,7 @@ class AliasInlines(admin.TabularInline):
model = Alias model = Alias
@admin.register(Note, site=admin_site) @admin.register(Note)
class NoteAdmin(PolymorphicParentModelAdmin): class NoteAdmin(PolymorphicParentModelAdmin):
""" """
Parent regrouping all note types as children Parent regrouping all note types as children
@ -44,7 +42,7 @@ class NoteAdmin(PolymorphicParentModelAdmin):
search_fields = ['alias__name'] search_fields = ['alias__name']
@admin.register(NoteClub, site=admin_site) @admin.register(NoteClub)
class NoteClubAdmin(PolymorphicChildModelAdmin): class NoteClubAdmin(PolymorphicChildModelAdmin):
""" """
Child for a club note, see NoteAdmin Child for a club note, see NoteAdmin
@ -68,7 +66,7 @@ class NoteClubAdmin(PolymorphicChildModelAdmin):
return False return False
@admin.register(NoteSpecial, site=admin_site) @admin.register(NoteSpecial)
class NoteSpecialAdmin(PolymorphicChildModelAdmin): class NoteSpecialAdmin(PolymorphicChildModelAdmin):
""" """
Child for a special note, see NoteAdmin Child for a special note, see NoteAdmin
@ -76,7 +74,7 @@ class NoteSpecialAdmin(PolymorphicChildModelAdmin):
readonly_fields = ('balance',) readonly_fields = ('balance',)
@admin.register(NoteUser, site=admin_site) @admin.register(NoteUser)
class NoteUserAdmin(PolymorphicChildModelAdmin): class NoteUserAdmin(PolymorphicChildModelAdmin):
""" """
Child for an user note, see NoteAdmin Child for an user note, see NoteAdmin
@ -99,7 +97,7 @@ class NoteUserAdmin(PolymorphicChildModelAdmin):
return False return False
@admin.register(Transaction, site=admin_site) @admin.register(Transaction)
class TransactionAdmin(PolymorphicParentModelAdmin): class TransactionAdmin(PolymorphicParentModelAdmin):
""" """
Admin customisation for Transaction Admin customisation for Transaction
@ -140,21 +138,21 @@ class TransactionAdmin(PolymorphicParentModelAdmin):
return [] return []
@admin.register(MembershipTransaction, site=admin_site) @admin.register(MembershipTransaction)
class MembershipTransactionAdmin(PolymorphicChildModelAdmin): class MembershipTransactionAdmin(PolymorphicChildModelAdmin):
""" """
Admin customisation for MembershipTransaction Admin customisation for MembershipTransaction
""" """
@admin.register(SpecialTransaction, site=admin_site) @admin.register(SpecialTransaction)
class SpecialTransactionAdmin(PolymorphicChildModelAdmin): class SpecialTransactionAdmin(PolymorphicChildModelAdmin):
""" """
Admin customisation for SpecialTransaction Admin customisation for SpecialTransaction
""" """
@admin.register(TransactionTemplate, site=admin_site) @admin.register(TransactionTemplate)
class TransactionTemplateAdmin(admin.ModelAdmin): class TransactionTemplateAdmin(admin.ModelAdmin):
""" """
Admin customisation for TransactionTemplate Admin customisation for TransactionTemplate
@ -172,7 +170,7 @@ class TransactionTemplateAdmin(admin.ModelAdmin):
poly_destination.short_description = _('destination') poly_destination.short_description = _('destination')
@admin.register(TemplateCategory, site=admin_site) @admin.register(TemplateCategory)
class TemplateCategoryAdmin(admin.ModelAdmin): class TemplateCategoryAdmin(admin.ModelAdmin):
""" """
Admin customisation for TransactionTemplate Admin customisation for TransactionTemplate

View File

@ -118,8 +118,9 @@ class ConsumerSerializer(serializers.ModelSerializer):
""" """
# If the user has no right to see the note, then we only display the note identifier # If the user has no right to see the note, then we only display the note identifier
if PermissionBackend.check_perm(get_current_authenticated_user(), "note.view_note", obj.note): if PermissionBackend.check_perm(get_current_authenticated_user(), "note.view_note", obj.note):
print(obj.pk)
return NotePolymorphicSerializer().to_representation(obj.note) return NotePolymorphicSerializer().to_representation(obj.note)
return dict(id=obj.note.id) return dict(id=obj.id)
def get_email_confirmed(self, obj): def get_email_confirmed(self, obj):
if isinstance(obj.note, NoteUser): if isinstance(obj.note, NoteUser):

View File

@ -109,7 +109,7 @@ class ConsumerViewSet(ReadOnlyProtectedModelViewSet):
queryset = queryset.filter( queryset = queryset.filter(
Q(name__regex="^" + alias) Q(name__regex="^" + alias)
| Q(normalized_name__regex="^" + Alias.normalize(alias)) | Q(normalized_name__regex="^" + Alias.normalize(alias))
| Q(normalized_name__regex="^" + alias.lower())).order_by('name') | Q(normalized_name__regex="^" + alias.lower()))
return queryset return queryset

View File

@ -3,11 +3,10 @@
from django.contrib import admin from django.contrib import admin
from note_kfet.admin import admin_site
from .models import Permission, PermissionMask, Role from .models import Permission, PermissionMask, Role
@admin.register(PermissionMask, site=admin_site) @admin.register(PermissionMask)
class PermissionMaskAdmin(admin.ModelAdmin): class PermissionMaskAdmin(admin.ModelAdmin):
""" """
Admin customisation for PermissionMask Admin customisation for PermissionMask
@ -15,7 +14,7 @@ class PermissionMaskAdmin(admin.ModelAdmin):
list_display = ('description', 'rank', ) list_display = ('description', 'rank', )
@admin.register(Permission, site=admin_site) @admin.register(Permission)
class PermissionAdmin(admin.ModelAdmin): class PermissionAdmin(admin.ModelAdmin):
""" """
Admin customisation for Permission Admin customisation for Permission
@ -23,7 +22,7 @@ class PermissionAdmin(admin.ModelAdmin):
list_display = ('type', 'model', 'field', 'mask', 'description', ) list_display = ('type', 'model', 'field', 'mask', 'description', )
@admin.register(Role, site=admin_site) @admin.register(Role)
class RoleAdmin(admin.ModelAdmin): class RoleAdmin(admin.ModelAdmin):
""" """
Admin customisation for Role Admin customisation for Role

View File

@ -42,7 +42,7 @@ class PermissionBackend(ModelBackend):
for membership in memberships: for membership in memberships:
for role in membership.roles.all(): for role in membership.roles.all():
for perm in role.permissions.filter(type=t, mask__rank__lte=get_current_session().get("permission_mask", -1)).all(): for perm in role.permissions.filter(type=t, mask__rank__lte=get_current_session().get("permission_mask", 42)).all():
if not perm.permanent: if not perm.permanent:
if membership.date_start > timezone.now().date() or membership.date_end < timezone.now().date(): if membership.date_start > timezone.now().date() or membership.date_end < timezone.now().date():
continue continue
@ -101,7 +101,7 @@ class PermissionBackend(ModelBackend):
# Anonymous users can't do anything # Anonymous users can't do anything
return Q(pk=-1) return Q(pk=-1)
if user.is_superuser and get_current_session().get("permission_mask", -1) >= 42: if user.is_superuser and get_current_session().get("permission_mask", 42) >= 42:
# Superusers have all rights # Superusers have all rights
return Q() return Q()
@ -137,7 +137,7 @@ class PermissionBackend(ModelBackend):
if sess is not None and sess.session_key is None: if sess is not None and sess.session_key is None:
return False return False
if user_obj.is_superuser and get_current_session().get("permission_mask", -1) >= 42: if user_obj.is_superuser and get_current_session().get("permission_mask", 42) >= 42:
return True return True
if obj is None: if obj is None:

View File

@ -131,7 +131,7 @@
"type": "change", "type": "change",
"mask": 1, "mask": 1,
"field": "last_login", "field": "last_login",
"permanent": true, "permanent": false,
"description": "Change myself's last login" "description": "Change myself's last login"
} }
}, },
@ -211,7 +211,7 @@
"type": "delete", "type": "delete",
"mask": 1, "mask": 1,
"field": "", "field": "",
"permanent": true, "permanent": false,
"description": "Delete API Token" "description": "Delete API Token"
} }
}, },
@ -369,7 +369,7 @@
], ],
"query": "{\"pk\": [\"club\", \"pk\"]}", "query": "{\"pk\": [\"club\", \"pk\"]}",
"type": "view", "type": "view",
"mask": 3, "mask": 1,
"field": "", "field": "",
"permanent": false, "permanent": false,
"description": "View club infos" "description": "View club infos"
@ -2119,134 +2119,6 @@
"description": "Update the clothing size field of my own WEI Registration" "description": "Update the clothing size field of my own WEI Registration"
} }
}, },
{
"model": "permission.permission",
"pk": 132,
"fields": {
"model": [
"note",
"recurrenttransaction"
],
"query": "{}",
"type": "add",
"mask": 2,
"field": "",
"permanent": false,
"description": "Create any recurrent transaction"
}
},
{
"model": "permission.permission",
"pk": 133,
"fields": {
"model": [
"note",
"transaction"
],
"query": "[\"AND\", [\"OR\", {\"source\": [\"club\", \"note\"]}, {\"destination\": [\"club\", \"note\"]}], [\"OR\", {\"amount__lte\": {\"F\": [\"ADD\", [\"F\", \"source__balance\"], 5000]}}, {\"valid\": true}]]",
"type": "change",
"mask": 1,
"field": "invalidity_reason",
"permanent": false,
"description": "Update invalidity reason of a club transaction if possible"
}
},
{
"model": "permission.permission",
"pk": 134,
"fields": {
"model": [
"note",
"transaction"
],
"query": "{}",
"type": "change",
"mask": 1,
"field": "invalidity_reason",
"permanent": false,
"description": "Update invalidity reason of a transaction"
}
},
{
"model": "permission.permission",
"pk": 135,
"fields": {
"model": [
"auth",
"user"
],
"query": "{}",
"type": "view",
"mask": 3,
"field": "",
"permanent": false,
"description": "View any user"
}
},
{
"model": "permission.permission",
"pk": 136,
"fields": {
"model": [
"member",
"profile"
],
"query": "{}",
"type": "view",
"mask": 3,
"field": "",
"permanent": false,
"description": "View any profile"
}
},
{
"model": "permission.permission",
"pk": 137,
"fields": {
"model": [
"member",
"club"
],
"query": "{}",
"type": "view",
"mask": 3,
"field": "",
"permanent": false,
"description": "View any club"
}
},
{
"model": "permission.permission",
"pk": 138,
"fields": {
"model": [
"member",
"club"
],
"query": "{}",
"type": "change",
"mask": 3,
"field": "",
"permanent": false,
"description": "Change any club"
}
},
{
"model": "permission.permission",
"pk": 139,
"fields": {
"model": [
"member",
"club"
],
"query": "{}",
"type": "add",
"mask": 3,
"field": "",
"permanent": false,
"description": "Create any club"
}
},
{ {
"model": "permission.role", "model": "permission.role",
"pk": 1, "pk": 1,
@ -2355,8 +2227,7 @@
60, 60,
61, 61,
62, 62,
127, 127
133
] ]
} }
}, },
@ -2408,14 +2279,7 @@
69, 69,
71, 71,
72, 72,
73, 73
132,
134,
135,
136,
137,
138,
139
] ]
} }
}, },
@ -2551,20 +2415,7 @@
123, 123,
124, 124,
125, 125,
126, 126
127,
128,
129,
130,
131,
132,
133,
134,
135,
136,
137,
138,
139
] ]
} }
}, },

View File

@ -19,8 +19,8 @@ class StrongDjangoObjectPermissions(DjangoObjectPermissions):
'OPTIONS': [], 'OPTIONS': [],
'HEAD': [], 'HEAD': [],
'POST': ['%(app_label)s.add_%(model_name)s'], 'POST': ['%(app_label)s.add_%(model_name)s'],
'PUT': [], # ['%(app_label)s.change_%(model_name)s'], 'PUT': ['%(app_label)s.change_%(model_name)s'],
'PATCH': [], # ['%(app_label)s.change_%(model_name)s'], 'PATCH': ['%(app_label)s.change_%(model_name)s'],
'DELETE': ['%(app_label)s.delete_%(model_name)s'], 'DELETE': ['%(app_label)s.delete_%(model_name)s'],
} }

View File

@ -1,7 +1,6 @@
# Copyright (C) 2018-2020 by BDE ENS Paris-Saclay # Copyright (C) 2018-2020 by BDE ENS Paris-Saclay
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
from django.contrib.auth.models import AnonymousUser
from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.models import ContentType
from django.template.defaultfilters import stringfilter from django.template.defaultfilters import stringfilter
from django import template from django import template
@ -17,9 +16,9 @@ def not_empty_model_list(model_name):
""" """
user = get_current_authenticated_user() user = get_current_authenticated_user()
session = get_current_session() session = get_current_session()
if user is None or isinstance(user, AnonymousUser): if user is None:
return False return False
elif user.is_superuser and session.get("permission_mask", -1) >= 42: elif user.is_superuser and session.get("permission_mask", 0) >= 42:
return True return True
qs = model_list(model_name) qs = model_list(model_name)
return qs.exists() return qs.exists()
@ -32,9 +31,9 @@ def not_empty_model_change_list(model_name):
""" """
user = get_current_authenticated_user() user = get_current_authenticated_user()
session = get_current_session() session = get_current_session()
if user is None or isinstance(user, AnonymousUser): if user is None:
return False return False
elif user.is_superuser and session.get("permission_mask", -1) >= 42: elif user.is_superuser and session.get("permission_mask", 0) >= 42:
return True return True
qs = model_list(model_name, "change") qs = model_list(model_name, "change")
return qs.exists() return qs.exists()
@ -46,11 +45,11 @@ def model_list(model_name, t="view", fetch=True):
Return the queryset of all visible instances of the given model. Return the queryset of all visible instances of the given model.
""" """
user = get_current_authenticated_user() user = get_current_authenticated_user()
if user is None:
return False
spl = model_name.split(".") spl = model_name.split(".")
ct = ContentType.objects.get(app_label=spl[0], model=spl[1]) ct = ContentType.objects.get(app_label=spl[0], model=spl[1])
qs = ct.model_class().objects.filter(PermissionBackend.filter_queryset(user, ct, t)) qs = ct.model_class().objects.filter(PermissionBackend.filter_queryset(user, ct, t))
if user is None or isinstance(user, AnonymousUser):
return qs.none()
if fetch: if fetch:
qs = qs.all() qs = qs.all()
return qs return qs
@ -74,9 +73,9 @@ def can_create_transaction():
""" """
user = get_current_authenticated_user() user = get_current_authenticated_user()
session = get_current_session() session = get_current_session()
if user is None or isinstance(user, AnonymousUser): if user is None:
return False return False
elif user.is_superuser and session.get("permission_mask", -1) >= 42: elif user.is_superuser and session.get("permission_mask", 0) >= 42:
return True return True
if session.get("can_create_transaction", None): if session.get("can_create_transaction", None):
return session.get("can_create_transaction", None) == 1 return session.get("can_create_transaction", None) == 1

View File

@ -3,11 +3,10 @@
from django.contrib import admin from django.contrib import admin
from note_kfet.admin import admin_site
from .models import RemittanceType, Remittance, SogeCredit from .models import RemittanceType, Remittance, SogeCredit
@admin.register(RemittanceType, site=admin_site) @admin.register(RemittanceType)
class RemittanceTypeAdmin(admin.ModelAdmin): class RemittanceTypeAdmin(admin.ModelAdmin):
""" """
Admin customisation for RemiitanceType Admin customisation for RemiitanceType
@ -15,7 +14,7 @@ class RemittanceTypeAdmin(admin.ModelAdmin):
list_display = ('note', ) list_display = ('note', )
@admin.register(Remittance, site=admin_site) @admin.register(Remittance)
class RemittanceAdmin(admin.ModelAdmin): class RemittanceAdmin(admin.ModelAdmin):
""" """
Admin customisation for Remittance Admin customisation for Remittance
@ -28,4 +27,4 @@ class RemittanceAdmin(admin.ModelAdmin):
return not obj.closed and super().has_change_permission(request, obj) return not obj.closed and super().has_change_permission(request, obj)
admin_site.register(SogeCredit) admin.site.register(SogeCredit)

View File

@ -1,12 +1,13 @@
# Copyright (C) 2018-2020 by BDE ENS Paris-Saclay # Copyright (C) 2018-2020 by BDE ENS Paris-Saclay
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
from note_kfet.admin import admin_site from django.contrib import admin
from .models import WEIClub, WEIRegistration, WEIMembership, WEIRole, Bus, BusTeam from .models import WEIClub, WEIRegistration, WEIMembership, WEIRole, Bus, BusTeam
admin_site.register(WEIClub) admin.site.register(WEIClub)
admin_site.register(WEIRegistration) admin.site.register(WEIRegistration)
admin_site.register(WEIMembership) admin.site.register(WEIMembership)
admin_site.register(WEIRole) admin.site.register(WEIRole)
admin_site.register(Bus) admin.site.register(Bus)
admin_site.register(BusTeam) admin.site.register(BusTeam)

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-07-29 10:56+0200\n" "POT-Creation-Date: 2020-07-28 20:42+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -186,12 +186,12 @@ msgstr ""
msgid "Type" msgid "Type"
msgstr "" msgstr ""
#: apps/activity/tables.py:77 apps/member/forms.py:92 #: apps/activity/tables.py:77 apps/member/forms.py:83
#: apps/registration/forms.py:64 apps/treasury/forms.py:120 #: apps/registration/forms.py:64 apps/treasury/forms.py:120
msgid "Last name" msgid "Last name"
msgstr "" msgstr ""
#: apps/activity/tables.py:79 apps/member/forms.py:97 #: apps/activity/tables.py:79 apps/member/forms.py:88
#: apps/registration/forms.py:69 apps/treasury/forms.py:122 #: apps/registration/forms.py:69 apps/treasury/forms.py:122
#: templates/note/transaction_form.html:126 #: templates/note/transaction_form.html:126
msgid "First name" msgid "First name"
@ -205,7 +205,7 @@ msgstr ""
msgid "Balance" msgid "Balance"
msgstr "" msgstr ""
#: apps/activity/views.py:47 templates/base.html:121 #: apps/activity/views.py:47 templates/base.html:120
msgid "Activities" msgid "Activities"
msgstr "" msgstr ""
@ -279,35 +279,31 @@ msgstr ""
msgid "member" msgid "member"
msgstr "" msgstr ""
#: apps/member/forms.py:46 apps/member/views.py:77 #: apps/member/forms.py:62 apps/registration/forms.py:44
msgid "An alias with a similar name already exists."
msgstr ""
#: apps/member/forms.py:71 apps/registration/forms.py:44
msgid "Inscription paid by Société Générale" msgid "Inscription paid by Société Générale"
msgstr "" msgstr ""
#: apps/member/forms.py:73 apps/registration/forms.py:46 #: apps/member/forms.py:64 apps/registration/forms.py:46
msgid "Check this case is the Société Générale paid the inscription." msgid "Check this case is the Société Générale paid the inscription."
msgstr "" msgstr ""
#: apps/member/forms.py:78 apps/registration/forms.py:51 #: apps/member/forms.py:69 apps/registration/forms.py:51
msgid "Credit type" msgid "Credit type"
msgstr "" msgstr ""
#: apps/member/forms.py:79 apps/registration/forms.py:52 #: apps/member/forms.py:70 apps/registration/forms.py:52
msgid "No credit" msgid "No credit"
msgstr "" msgstr ""
#: apps/member/forms.py:81 #: apps/member/forms.py:72
msgid "You can credit the note of the user." msgid "You can credit the note of the user."
msgstr "" msgstr ""
#: apps/member/forms.py:85 apps/registration/forms.py:57 #: apps/member/forms.py:76 apps/registration/forms.py:57
msgid "Credit amount" msgid "Credit amount"
msgstr "" msgstr ""
#: apps/member/forms.py:102 apps/registration/forms.py:74 #: apps/member/forms.py:93 apps/registration/forms.py:74
#: apps/treasury/forms.py:124 templates/note/transaction_form.html:132 #: apps/treasury/forms.py:124 templates/note/transaction_form.html:132
msgid "Bank" msgid "Bank"
msgstr "" msgstr ""
@ -545,10 +541,14 @@ msgstr ""
#: apps/member/views.py:67 templates/member/profile_info.html:47 #: apps/member/views.py:67 templates/member/profile_info.html:47
#: templates/registration/future_profile_detail.html:48 #: templates/registration/future_profile_detail.html:48
#: templates/wei/weimembership_form.html:130 #: templates/wei/weimembership_form.html:124
msgid "Update Profile" msgid "Update Profile"
msgstr "" msgstr ""
#: apps/member/views.py:77
msgid "An alias with a similar name already exists."
msgstr ""
#: apps/member/views.py:183 #: apps/member/views.py:183
msgid "Search user" msgid "Search user"
msgstr "" msgstr ""
@ -760,7 +760,7 @@ msgid ""
msgstr "" msgstr ""
#: apps/note/models/transactions.py:228 #: apps/note/models/transactions.py:228
#: templates/activity/activity_entry.html:13 templates/base.html:99 #: templates/activity/activity_entry.html:13 templates/base.html:98
#: templates/note/transaction_form.html:19 #: templates/note/transaction_form.html:19
#: templates/note/transaction_form.html:140 #: templates/note/transaction_form.html:140
msgid "Transfer" msgid "Transfer"
@ -831,7 +831,7 @@ msgstr ""
msgid "Transfer money" msgid "Transfer money"
msgstr "" msgstr ""
#: apps/note/views.py:140 templates/base.html:94 #: apps/note/views.py:140 templates/base.html:93
msgid "Consumptions" msgid "Consumptions"
msgstr "" msgstr ""
@ -975,7 +975,7 @@ msgid ""
"The entered amount is not enough for the memberships, should be at least {}" "The entered amount is not enough for the memberships, should be at least {}"
msgstr "" msgstr ""
#: apps/treasury/apps.py:12 templates/base.html:126 #: apps/treasury/apps.py:12 templates/base.html:125
msgid "Treasury" msgid "Treasury"
msgstr "" msgstr ""
@ -1173,7 +1173,7 @@ msgid "No"
msgstr "" msgstr ""
#: apps/wei/apps.py:10 apps/wei/models.py:48 apps/wei/models.py:49 #: apps/wei/apps.py:10 apps/wei/models.py:48 apps/wei/models.py:49
#: apps/wei/models.py:60 apps/wei/models.py:166 templates/base.html:131 #: apps/wei/models.py:60 apps/wei/models.py:166 templates/base.html:130
msgid "WEI" msgid "WEI"
msgstr "" msgstr ""
@ -1267,7 +1267,7 @@ msgstr ""
msgid "Caution check given" msgid "Caution check given"
msgstr "" msgstr ""
#: apps/wei/models.py:180 templates/wei/weimembership_form.html:68 #: apps/wei/models.py:180 templates/wei/weimembership_form.html:62
msgid "birth date" msgid "birth date"
msgstr "" msgstr ""
@ -1287,39 +1287,39 @@ msgstr ""
msgid "gender" msgid "gender"
msgstr "" msgstr ""
#: apps/wei/models.py:199 templates/wei/weimembership_form.html:62 #: apps/wei/models.py:199
msgid "clothing cut" msgid "clothing cut"
msgstr "" msgstr ""
#: apps/wei/models.py:212 templates/wei/weimembership_form.html:65 #: apps/wei/models.py:212
msgid "clothing size" msgid "clothing size"
msgstr "" msgstr ""
#: apps/wei/models.py:218 templates/wei/weimembership_form.html:71 #: apps/wei/models.py:218 templates/wei/weimembership_form.html:65
msgid "health issues" msgid "health issues"
msgstr "" msgstr ""
#: apps/wei/models.py:223 templates/wei/weimembership_form.html:74 #: apps/wei/models.py:223 templates/wei/weimembership_form.html:68
msgid "emergency contact name" msgid "emergency contact name"
msgstr "" msgstr ""
#: apps/wei/models.py:228 templates/wei/weimembership_form.html:77 #: apps/wei/models.py:228 templates/wei/weimembership_form.html:71
msgid "emergency contact phone" msgid "emergency contact phone"
msgstr "" msgstr ""
#: apps/wei/models.py:233 templates/wei/weimembership_form.html:80 #: apps/wei/models.py:233 templates/wei/weimembership_form.html:74
msgid "" msgid ""
"Register on the mailing list to stay informed of the events of the campus (1 " "Register on the mailing list to stay informed of the events of the campus (1 "
"mail/week)" "mail/week)"
msgstr "" msgstr ""
#: apps/wei/models.py:238 templates/wei/weimembership_form.html:83 #: apps/wei/models.py:238 templates/wei/weimembership_form.html:77
msgid "" msgid ""
"Register on the mailing list to stay informed of the sport events of the " "Register on the mailing list to stay informed of the sport events of the "
"campus (1 mail/week)" "campus (1 mail/week)"
msgstr "" msgstr ""
#: apps/wei/models.py:243 templates/wei/weimembership_form.html:86 #: apps/wei/models.py:243 templates/wei/weimembership_form.html:80
msgid "" msgid ""
"Register on the mailing list to stay informed of the art events of the " "Register on the mailing list to stay informed of the art events of the "
"campus (1 mail/week)" "campus (1 mail/week)"
@ -1550,27 +1550,27 @@ msgstr ""
msgid "The ENS Paris-Saclay BDE note." msgid "The ENS Paris-Saclay BDE note."
msgstr "" msgstr ""
#: templates/base.html:104 #: templates/base.html:103
msgid "Users" msgid "Users"
msgstr "" msgstr ""
#: templates/base.html:109 #: templates/base.html:108
msgid "Clubs" msgid "Clubs"
msgstr "" msgstr ""
#: templates/base.html:115 #: templates/base.html:114
msgid "Registrations" msgid "Registrations"
msgstr "" msgstr ""
#: templates/base.html:135 #: templates/base.html:134
msgid "Rights" msgid "Rights"
msgstr "" msgstr ""
#: templates/base.html:139 #: templates/base.html:138
msgid "Administration" msgid "Administration"
msgstr "" msgstr ""
#: templates/base.html:178 #: templates/base.html:177
msgid "" msgid ""
"Your e-mail address is not validated. Please check your mail inbox and click " "Your e-mail address is not validated. Please check your mail inbox and click "
"on the validation link." "on the validation link."
@ -1850,8 +1850,8 @@ msgid "Validate account"
msgstr "" msgstr ""
#: templates/registration/future_profile_detail.html:64 #: templates/registration/future_profile_detail.html:64
#: templates/wei/weimembership_form.html:140 #: templates/wei/weimembership_form.html:134
#: templates/wei/weimembership_form.html:198 #: templates/wei/weimembership_form.html:192
msgid "Validate registration" msgid "Validate registration"
msgstr "" msgstr ""
@ -1872,7 +1872,7 @@ msgid "Log in again"
msgstr "" msgstr ""
#: templates/registration/login.html:7 templates/registration/login.html:8 #: templates/registration/login.html:7 templates/registration/login.html:8
#: templates/registration/login.html:22 #: templates/registration/login.html:21
#: templates/registration/password_reset_complete.html:10 #: templates/registration/password_reset_complete.html:10
msgid "Log in" msgid "Log in"
msgstr "" msgstr ""
@ -1881,11 +1881,10 @@ msgstr ""
#, python-format #, python-format
msgid "" msgid ""
"You are authenticated as %(username)s, but are not authorized to access this " "You are authenticated as %(username)s, but are not authorized to access this "
"page. Would you like to login to a different account, or with a higher " "page. Would you like to login to a different account?"
"permission mask?"
msgstr "" msgstr ""
#: templates/registration/login.html:23 #: templates/registration/login.html:22
msgid "Forgotten your password or username?" msgid "Forgotten your password or username?"
msgstr "" msgstr ""
@ -2205,64 +2204,64 @@ msgstr ""
msgid "ENS year" msgid "ENS year"
msgstr "" msgstr ""
#: templates/wei/weimembership_form.html:89 #: templates/wei/weimembership_form.html:83
msgid "Payment from Société générale" msgid "Payment from Société générale"
msgstr "" msgstr ""
#: templates/wei/weimembership_form.html:93 #: templates/wei/weimembership_form.html:87
msgid "Suggested bus from the survey:" msgid "Suggested bus from the survey:"
msgstr "" msgstr ""
#: templates/wei/weimembership_form.html:98 #: templates/wei/weimembership_form.html:92
msgid "Raw survey information" msgid "Raw survey information"
msgstr "" msgstr ""
#: templates/wei/weimembership_form.html:108 #: templates/wei/weimembership_form.html:102
msgid "The algorithm didn't run." msgid "The algorithm didn't run."
msgstr "" msgstr ""
#: templates/wei/weimembership_form.html:111 #: templates/wei/weimembership_form.html:105
msgid "caution check given" msgid "caution check given"
msgstr "" msgstr ""
#: templates/wei/weimembership_form.html:115 #: templates/wei/weimembership_form.html:109
msgid "preferred bus" msgid "preferred bus"
msgstr "" msgstr ""
#: templates/wei/weimembership_form.html:118 #: templates/wei/weimembership_form.html:112
msgid "preferred team" msgid "preferred team"
msgstr "" msgstr ""
#: templates/wei/weimembership_form.html:121 #: templates/wei/weimembership_form.html:115
msgid "preferred roles" msgid "preferred roles"
msgstr "" msgstr ""
#: templates/wei/weimembership_form.html:128 #: templates/wei/weimembership_form.html:122
#: templates/wei/weiregistration_confirm_delete.html:31 #: templates/wei/weiregistration_confirm_delete.html:31
msgid "Update registration" msgid "Update registration"
msgstr "" msgstr ""
#: templates/wei/weimembership_form.html:144 #: templates/wei/weimembership_form.html:138
msgid "The registration is already validated and can't be unvalidated." msgid "The registration is already validated and can't be unvalidated."
msgstr "" msgstr ""
#: templates/wei/weimembership_form.html:145 #: templates/wei/weimembership_form.html:139
msgid "The user joined the bus" msgid "The user joined the bus"
msgstr "" msgstr ""
#: templates/wei/weimembership_form.html:146 #: templates/wei/weimembership_form.html:140
msgid "in the team" msgid "in the team"
msgstr "" msgstr ""
#: templates/wei/weimembership_form.html:147 #: templates/wei/weimembership_form.html:141
msgid "in no team (staff)" msgid "in no team (staff)"
msgstr "" msgstr ""
#: templates/wei/weimembership_form.html:147 #: templates/wei/weimembership_form.html:141
msgid "with the following roles:" msgid "with the following roles:"
msgstr "" msgstr ""
#: templates/wei/weimembership_form.html:152 #: templates/wei/weimembership_form.html:146
msgid "" msgid ""
"\n" "\n"
" The WEI will be paid by Société générale. The " " The WEI will be paid by Société générale. The "
@ -2274,7 +2273,7 @@ msgid ""
" " " "
msgstr "" msgstr ""
#: templates/wei/weimembership_form.html:162 #: templates/wei/weimembership_form.html:156
#, python-format #, python-format
msgid "" msgid ""
"\n" "\n"
@ -2283,15 +2282,15 @@ msgid ""
" " " "
msgstr "" msgstr ""
#: templates/wei/weimembership_form.html:169 #: templates/wei/weimembership_form.html:163
msgid "The note has enough money, the registration is possible." msgid "The note has enough money, the registration is possible."
msgstr "" msgstr ""
#: templates/wei/weimembership_form.html:176 #: templates/wei/weimembership_form.html:170
msgid "The user didn't give her/his caution check." msgid "The user didn't give her/his caution check."
msgstr "" msgstr ""
#: templates/wei/weimembership_form.html:184 #: templates/wei/weimembership_form.html:178
#, python-format #, python-format
msgid "" msgid ""
"\n" "\n"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-07-29 10:56+0200\n" "POT-Creation-Date: 2020-07-28 20:42+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -187,12 +187,12 @@ msgstr "supprimer"
msgid "Type" msgid "Type"
msgstr "Type" msgstr "Type"
#: apps/activity/tables.py:77 apps/member/forms.py:92 #: apps/activity/tables.py:77 apps/member/forms.py:83
#: apps/registration/forms.py:64 apps/treasury/forms.py:120 #: apps/registration/forms.py:64 apps/treasury/forms.py:120
msgid "Last name" msgid "Last name"
msgstr "Nom de famille" msgstr "Nom de famille"
#: apps/activity/tables.py:79 apps/member/forms.py:97 #: apps/activity/tables.py:79 apps/member/forms.py:88
#: apps/registration/forms.py:69 apps/treasury/forms.py:122 #: apps/registration/forms.py:69 apps/treasury/forms.py:122
#: templates/note/transaction_form.html:126 #: templates/note/transaction_form.html:126
msgid "First name" msgid "First name"
@ -206,7 +206,7 @@ msgstr "Note"
msgid "Balance" msgid "Balance"
msgstr "Solde du compte" msgstr "Solde du compte"
#: apps/activity/views.py:47 templates/base.html:121 #: apps/activity/views.py:47 templates/base.html:120
msgid "Activities" msgid "Activities"
msgstr "Activités" msgstr "Activités"
@ -280,35 +280,31 @@ msgstr "journaux de modifications"
msgid "member" msgid "member"
msgstr "adhérent" msgstr "adhérent"
#: apps/member/forms.py:46 apps/member/views.py:77 #: apps/member/forms.py:62 apps/registration/forms.py:44
msgid "An alias with a similar name already exists."
msgstr "Un alias avec un nom similaire existe déjà."
#: apps/member/forms.py:71 apps/registration/forms.py:44
msgid "Inscription paid by Société Générale" msgid "Inscription paid by Société Générale"
msgstr "Inscription payée par la Société générale" msgstr "Inscription payée par la Société générale"
#: apps/member/forms.py:73 apps/registration/forms.py:46 #: apps/member/forms.py:64 apps/registration/forms.py:46
msgid "Check this case is the Société Générale paid the inscription." msgid "Check this case is the Société Générale paid the inscription."
msgstr "Cochez cette case si la Société Générale a payé l'inscription." msgstr "Cochez cette case si la Société Générale a payé l'inscription."
#: apps/member/forms.py:78 apps/registration/forms.py:51 #: apps/member/forms.py:69 apps/registration/forms.py:51
msgid "Credit type" msgid "Credit type"
msgstr "Type de rechargement" msgstr "Type de rechargement"
#: apps/member/forms.py:79 apps/registration/forms.py:52 #: apps/member/forms.py:70 apps/registration/forms.py:52
msgid "No credit" msgid "No credit"
msgstr "Pas de rechargement" msgstr "Pas de rechargement"
#: apps/member/forms.py:81 #: apps/member/forms.py:72
msgid "You can credit the note of the user." msgid "You can credit the note of the user."
msgstr "Vous pouvez créditer la note de l'utisateur avant l'adhésion." msgstr "Vous pouvez créditer la note de l'utisateur avant l'adhésion."
#: apps/member/forms.py:85 apps/registration/forms.py:57 #: apps/member/forms.py:76 apps/registration/forms.py:57
msgid "Credit amount" msgid "Credit amount"
msgstr "Montant à créditer" msgstr "Montant à créditer"
#: apps/member/forms.py:102 apps/registration/forms.py:74 #: apps/member/forms.py:93 apps/registration/forms.py:74
#: apps/treasury/forms.py:124 templates/note/transaction_form.html:132 #: apps/treasury/forms.py:124 templates/note/transaction_form.html:132
msgid "Bank" msgid "Bank"
msgstr "Banque" msgstr "Banque"
@ -550,10 +546,14 @@ msgstr "Cette adresse doit être valide."
#: apps/member/views.py:67 templates/member/profile_info.html:47 #: apps/member/views.py:67 templates/member/profile_info.html:47
#: templates/registration/future_profile_detail.html:48 #: templates/registration/future_profile_detail.html:48
#: templates/wei/weimembership_form.html:130 #: templates/wei/weimembership_form.html:124
msgid "Update Profile" msgid "Update Profile"
msgstr "Modifier le profil" msgstr "Modifier le profil"
#: apps/member/views.py:77
msgid "An alias with a similar name already exists."
msgstr "Un alias avec un nom similaire existe déjà."
#: apps/member/views.py:183 #: apps/member/views.py:183
msgid "Search user" msgid "Search user"
msgstr "Chercher un utilisateur" msgstr "Chercher un utilisateur"
@ -770,7 +770,7 @@ msgstr ""
"note de destination n'est pas active." "note de destination n'est pas active."
#: apps/note/models/transactions.py:228 #: apps/note/models/transactions.py:228
#: templates/activity/activity_entry.html:13 templates/base.html:99 #: templates/activity/activity_entry.html:13 templates/base.html:98
#: templates/note/transaction_form.html:19 #: templates/note/transaction_form.html:19
#: templates/note/transaction_form.html:140 #: templates/note/transaction_form.html:140
msgid "Transfer" msgid "Transfer"
@ -843,7 +843,7 @@ msgstr "Éditer"
msgid "Transfer money" msgid "Transfer money"
msgstr "Transférer de l'argent" msgstr "Transférer de l'argent"
#: apps/note/views.py:140 templates/base.html:94 #: apps/note/views.py:140 templates/base.html:93
msgid "Consumptions" msgid "Consumptions"
msgstr "Consommations" msgstr "Consommations"
@ -1002,7 +1002,7 @@ msgstr ""
"Le montant crédité est trop faible pour adhérer, il doit être au minimum de " "Le montant crédité est trop faible pour adhérer, il doit être au minimum de "
"{}" "{}"
#: apps/treasury/apps.py:12 templates/base.html:126 #: apps/treasury/apps.py:12 templates/base.html:125
msgid "Treasury" msgid "Treasury"
msgstr "Trésorerie" msgstr "Trésorerie"
@ -1202,7 +1202,7 @@ msgid "No"
msgstr "Non" msgstr "Non"
#: apps/wei/apps.py:10 apps/wei/models.py:48 apps/wei/models.py:49 #: apps/wei/apps.py:10 apps/wei/models.py:48 apps/wei/models.py:49
#: apps/wei/models.py:60 apps/wei/models.py:166 templates/base.html:131 #: apps/wei/models.py:60 apps/wei/models.py:166 templates/base.html:130
msgid "WEI" msgid "WEI"
msgstr "WEI" msgstr "WEI"
@ -1303,7 +1303,7 @@ msgstr "Crédit de la Société générale"
msgid "Caution check given" msgid "Caution check given"
msgstr "Chèque de caution donné" msgstr "Chèque de caution donné"
#: apps/wei/models.py:180 templates/wei/weimembership_form.html:68 #: apps/wei/models.py:180 templates/wei/weimembership_form.html:62
msgid "birth date" msgid "birth date"
msgstr "date de naissance" msgstr "date de naissance"
@ -1323,27 +1323,27 @@ msgstr "Non-binaire"
msgid "gender" msgid "gender"
msgstr "genre" msgstr "genre"
#: apps/wei/models.py:199 templates/wei/weimembership_form.html:62 #: apps/wei/models.py:199
msgid "clothing cut" msgid "clothing cut"
msgstr "coupe de vêtement" msgstr "coupe de vêtement"
#: apps/wei/models.py:212 templates/wei/weimembership_form.html:65 #: apps/wei/models.py:212
msgid "clothing size" msgid "clothing size"
msgstr "taille de vêtement" msgstr "taille de vêtement"
#: apps/wei/models.py:218 templates/wei/weimembership_form.html:71 #: apps/wei/models.py:218 templates/wei/weimembership_form.html:65
msgid "health issues" msgid "health issues"
msgstr "problèmes de santé" msgstr "problèmes de santé"
#: apps/wei/models.py:223 templates/wei/weimembership_form.html:74 #: apps/wei/models.py:223 templates/wei/weimembership_form.html:68
msgid "emergency contact name" msgid "emergency contact name"
msgstr "Nom du contact en cas d'urgence" msgstr "Nom du contact en cas d'urgence"
#: apps/wei/models.py:228 templates/wei/weimembership_form.html:77 #: apps/wei/models.py:228 templates/wei/weimembership_form.html:71
msgid "emergency contact phone" msgid "emergency contact phone"
msgstr "Téléphone du contact en cas d'urgence" msgstr "Téléphone du contact en cas d'urgence"
#: apps/wei/models.py:233 templates/wei/weimembership_form.html:80 #: apps/wei/models.py:233 templates/wei/weimembership_form.html:74
msgid "" msgid ""
"Register on the mailing list to stay informed of the events of the campus (1 " "Register on the mailing list to stay informed of the events of the campus (1 "
"mail/week)" "mail/week)"
@ -1351,7 +1351,7 @@ msgstr ""
"S'inscrire sur la liste de diffusion pour rester informé des événements sur " "S'inscrire sur la liste de diffusion pour rester informé des événements sur "
"le campus (1 mail par semaine)" "le campus (1 mail par semaine)"
#: apps/wei/models.py:238 templates/wei/weimembership_form.html:83 #: apps/wei/models.py:238 templates/wei/weimembership_form.html:77
msgid "" msgid ""
"Register on the mailing list to stay informed of the sport events of the " "Register on the mailing list to stay informed of the sport events of the "
"campus (1 mail/week)" "campus (1 mail/week)"
@ -1359,7 +1359,7 @@ msgstr ""
"S'inscrire sur la liste de diffusion pour rester informé des actualités " "S'inscrire sur la liste de diffusion pour rester informé des actualités "
"sportives sur le campus (1 mail par semaine)" "sportives sur le campus (1 mail par semaine)"
#: apps/wei/models.py:243 templates/wei/weimembership_form.html:86 #: apps/wei/models.py:243 templates/wei/weimembership_form.html:80
msgid "" msgid ""
"Register on the mailing list to stay informed of the art events of the " "Register on the mailing list to stay informed of the art events of the "
"campus (1 mail/week)" "campus (1 mail/week)"
@ -1605,29 +1605,29 @@ msgstr "Toutes les activités"
msgid "The ENS Paris-Saclay BDE note." msgid "The ENS Paris-Saclay BDE note."
msgstr "La note du BDE de l'ENS Paris-Saclay." msgstr "La note du BDE de l'ENS Paris-Saclay."
#: templates/base.html:104 #: templates/base.html:103
msgid "Users" msgid "Users"
msgstr "Utilisateurs" msgstr "Utilisateurs"
#: templates/base.html:109 #: templates/base.html:108
msgid "Clubs" msgid "Clubs"
msgstr "Clubs" msgstr "Clubs"
#: templates/base.html:115 #: templates/base.html:114
msgid "Registrations" msgid "Registrations"
msgstr "Inscriptions" msgstr "Inscriptions"
#: templates/base.html:135 #: templates/base.html:134
msgid "Rights" msgid "Rights"
msgstr "Droits" msgstr "Droits"
#: templates/base.html:139 #: templates/base.html:138
#, fuzzy #, fuzzy
#| msgid "registration" #| msgid "registration"
msgid "Administration" msgid "Administration"
msgstr "inscription" msgstr "inscription"
#: templates/base.html:178 #: templates/base.html:177
msgid "" msgid ""
"Your e-mail address is not validated. Please check your mail inbox and click " "Your e-mail address is not validated. Please check your mail inbox and click "
"on the validation link." "on the validation link."
@ -1916,8 +1916,8 @@ msgid "Validate account"
msgstr "Valider le compte" msgstr "Valider le compte"
#: templates/registration/future_profile_detail.html:64 #: templates/registration/future_profile_detail.html:64
#: templates/wei/weimembership_form.html:140 #: templates/wei/weimembership_form.html:134
#: templates/wei/weimembership_form.html:198 #: templates/wei/weimembership_form.html:192
msgid "Validate registration" msgid "Validate registration"
msgstr "Valider l'inscription" msgstr "Valider l'inscription"
@ -1938,7 +1938,7 @@ msgid "Log in again"
msgstr "Se connecter à nouveau" msgstr "Se connecter à nouveau"
#: templates/registration/login.html:7 templates/registration/login.html:8 #: templates/registration/login.html:7 templates/registration/login.html:8
#: templates/registration/login.html:22 #: templates/registration/login.html:21
#: templates/registration/password_reset_complete.html:10 #: templates/registration/password_reset_complete.html:10
msgid "Log in" msgid "Log in"
msgstr "Se connecter" msgstr "Se connecter"
@ -1947,14 +1947,12 @@ msgstr "Se connecter"
#, python-format #, python-format
msgid "" msgid ""
"You are authenticated as %(username)s, but are not authorized to access this " "You are authenticated as %(username)s, but are not authorized to access this "
"page. Would you like to login to a different account, or with a higher " "page. Would you like to login to a different account?"
"permission mask?"
msgstr "" msgstr ""
"Vous êtes connecté en tant que %(username)s, mais vous n'avez le droit " "Vous êtes connecté en tant que %(username)s, mais vous n'avez le droit "
"d'accéder à cette page. Voulez-vous essayer avec un autre compte, ou avec " "d'accéder à cette page. Voulez vous essayer avec un autre compte ?"
"un masque de permissions plus fort ?"
#: templates/registration/login.html:23 #: templates/registration/login.html:22
msgid "Forgotten your password or username?" msgid "Forgotten your password or username?"
msgstr "Mot de passe ou pseudo oublié ?" msgstr "Mot de passe ou pseudo oublié ?"
@ -2311,64 +2309,64 @@ msgstr "Vérifier l'inscription"
msgid "ENS year" msgid "ENS year"
msgstr "Année à l'ENS" msgstr "Année à l'ENS"
#: templates/wei/weimembership_form.html:89 #: templates/wei/weimembership_form.html:83
msgid "Payment from Société générale" msgid "Payment from Société générale"
msgstr "Paiement de la Société générale" msgstr "Paiement de la Société générale"
#: templates/wei/weimembership_form.html:93 #: templates/wei/weimembership_form.html:87
msgid "Suggested bus from the survey:" msgid "Suggested bus from the survey:"
msgstr "Bus suggéré par le sondage :" msgstr "Bus suggéré par le sondage :"
#: templates/wei/weimembership_form.html:98 #: templates/wei/weimembership_form.html:92
msgid "Raw survey information" msgid "Raw survey information"
msgstr "Informations brutes du sondage" msgstr "Informations brutes du sondage"
#: templates/wei/weimembership_form.html:108 #: templates/wei/weimembership_form.html:102
msgid "The algorithm didn't run." msgid "The algorithm didn't run."
msgstr "L'algorithme n'a pas été exécuté." msgstr "L'algorithme n'a pas été exécuté."
#: templates/wei/weimembership_form.html:111 #: templates/wei/weimembership_form.html:105
msgid "caution check given" msgid "caution check given"
msgstr "chèque de caution donné" msgstr "chèque de caution donné"
#: templates/wei/weimembership_form.html:115 #: templates/wei/weimembership_form.html:109
msgid "preferred bus" msgid "preferred bus"
msgstr "bus préféré" msgstr "bus préféré"
#: templates/wei/weimembership_form.html:118 #: templates/wei/weimembership_form.html:112
msgid "preferred team" msgid "preferred team"
msgstr "équipe préférée" msgstr "équipe préférée"
#: templates/wei/weimembership_form.html:121 #: templates/wei/weimembership_form.html:115
msgid "preferred roles" msgid "preferred roles"
msgstr "rôles préférés" msgstr "rôles préférés"
#: templates/wei/weimembership_form.html:128 #: templates/wei/weimembership_form.html:122
#: templates/wei/weiregistration_confirm_delete.html:31 #: templates/wei/weiregistration_confirm_delete.html:31
msgid "Update registration" msgid "Update registration"
msgstr "Mettre à jour l'inscription" msgstr "Mettre à jour l'inscription"
#: templates/wei/weimembership_form.html:144 #: templates/wei/weimembership_form.html:138
msgid "The registration is already validated and can't be unvalidated." msgid "The registration is already validated and can't be unvalidated."
msgstr "L'inscription a déjà été validée et ne peut pas être dévalidée." msgstr "L'inscription a déjà été validée et ne peut pas être dévalidée."
#: templates/wei/weimembership_form.html:145 #: templates/wei/weimembership_form.html:139
msgid "The user joined the bus" msgid "The user joined the bus"
msgstr "L'utilisateur a rejoint le bus" msgstr "L'utilisateur a rejoint le bus"
#: templates/wei/weimembership_form.html:146 #: templates/wei/weimembership_form.html:140
msgid "in the team" msgid "in the team"
msgstr "dans l'équipe" msgstr "dans l'équipe"
#: templates/wei/weimembership_form.html:147 #: templates/wei/weimembership_form.html:141
msgid "in no team (staff)" msgid "in no team (staff)"
msgstr "dans aucune équipe (staff)" msgstr "dans aucune équipe (staff)"
#: templates/wei/weimembership_form.html:147 #: templates/wei/weimembership_form.html:141
msgid "with the following roles:" msgid "with the following roles:"
msgstr "avec les rôles suivants :" msgstr "avec les rôles suivants :"
#: templates/wei/weimembership_form.html:152 #: templates/wei/weimembership_form.html:146
msgid "" msgid ""
"\n" "\n"
" The WEI will be paid by Société générale. The " " The WEI will be paid by Société générale. The "
@ -2387,7 +2385,7 @@ msgstr ""
"aura validé la création du compte, ou bien changer de moyen de paiement.\n" "aura validé la création du compte, ou bien changer de moyen de paiement.\n"
" " " "
#: templates/wei/weimembership_form.html:162 #: templates/wei/weimembership_form.html:156
#, python-format #, python-format
msgid "" msgid ""
"\n" "\n"
@ -2400,15 +2398,15 @@ msgstr ""
"L'inscription va échouer.\n" "L'inscription va échouer.\n"
" " " "
#: templates/wei/weimembership_form.html:169 #: templates/wei/weimembership_form.html:163
msgid "The note has enough money, the registration is possible." msgid "The note has enough money, the registration is possible."
msgstr "La note a assez d'argent, l'inscription est possible." msgstr "La note a assez d'argent, l'inscription est possible."
#: templates/wei/weimembership_form.html:176 #: templates/wei/weimembership_form.html:170
msgid "The user didn't give her/his caution check." msgid "The user didn't give her/his caution check."
msgstr "L'utilisateur n'a pas donné son chèque de caution." msgstr "L'utilisateur n'a pas donné son chèque de caution."
#: templates/wei/weimembership_form.html:184 #: templates/wei/weimembership_form.html:178
#, python-format #, python-format
msgid "" msgid ""
"\n" "\n"

View File

@ -1,25 +0,0 @@
# Copyright (C) 2018-2020 by BDE ENS Paris-Saclay
# SPDX-License-Identifier: GPL-3.0-or-later
from django.contrib.admin import AdminSite
from django.contrib.sites.admin import Site, SiteAdmin
from member.views import CustomLoginView
from .middlewares import get_current_session
class StrongAdminSite(AdminSite):
def has_permission(self, request):
"""
Authorize only staff that have the correct permission mask
"""
session = get_current_session()
return request.user.is_active and request.user.is_staff and session.get("permission_mask", -1) >= 42
def login(self, request, extra_context=None):
return CustomLoginView.as_view()(request)
# Instantiate admin site and register some defaults
admin_site = StrongAdminSite()
admin_site.register(Site, SiteAdmin)

View File

@ -3,14 +3,13 @@
from django.conf import settings from django.conf import settings
from django.conf.urls.static import static from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path, include from django.urls import path, include
from django.views.defaults import bad_request, permission_denied, page_not_found, server_error from django.views.defaults import bad_request, permission_denied, page_not_found, server_error
from django.views.generic import RedirectView from django.views.generic import RedirectView
from member.views import CustomLoginView from member.views import CustomLoginView
from .admin import admin_site
urlpatterns = [ urlpatterns = [
# Dev so redirect to something random # Dev so redirect to something random
path('', RedirectView.as_view(pattern_name='note:transfer'), name='index'), path('', RedirectView.as_view(pattern_name='note:transfer'), name='index'),
@ -26,7 +25,7 @@ urlpatterns = [
# Include Django Contrib and Core routers # Include Django Contrib and Core routers
path('i18n/', include('django.conf.urls.i18n')), path('i18n/', include('django.conf.urls.i18n')),
path('admin/doc/', include('django.contrib.admindocs.urls')), path('admin/doc/', include('django.contrib.admindocs.urls')),
path('admin/', admin_site.urls, name="admin"), path('admin/', admin.site.urls, name="admin"),
path('accounts/login/', CustomLoginView.as_view()), path('accounts/login/', CustomLoginView.as_view()),
path('accounts/', include('django.contrib.auth.urls')), path('accounts/', include('django.contrib.auth.urls')),
path('api/', include('api.urls')), path('api/', include('api.urls')),

View File

@ -134,7 +134,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
<li class="nav-item active"> <li class="nav-item active">
<a class="nav-link" href="{% url 'permission:rights' %}"><i class="fas fa-balance-scale"></i> {% trans 'Rights' %}</a> <a class="nav-link" href="{% url 'permission:rights' %}"><i class="fas fa-balance-scale"></i> {% trans 'Rights' %}</a>
</li> </li>
{% if user.is_staff and ""|has_perm:user %} {% if user.is_staff %}
<li class="nav-item active"> <li class="nav-item active">
<a data-turbolinks="false" class="nav-link" href="{% url 'admin:index' %}"><i class="fas fa-user-cog"></i> {% trans 'Administration' %}</a> <a data-turbolinks="false" class="nav-link" href="{% url 'admin:index' %}"><i class="fas fa-user-cog"></i> {% trans 'Administration' %}</a>
</li> </li>
@ -179,8 +179,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
</div> </div>
{% endif %} {% endif %}
{% block contenttitle %}<h1>{{ title }}</h1>{% endblock %} {% block contenttitle %}<h1>{{ title }}</h1>{% endblock %}
<div class="alert alert-warning alert-dismissible"> <div class="alert alert-warning">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&#215;</button>
Attention : la Note Kfet 2020 est en phase de beta. Des fonctionnalités pourront être rajoutées d'ici à la version Attention : la Note Kfet 2020 est en phase de beta. Des fonctionnalités pourront être rajoutées d'ici à la version
finale, et des bugs peuvent survenir. Pour tout problème, merci d'envoyer un mail à l'adresse finale, et des bugs peuvent survenir. Pour tout problème, merci d'envoyer un mail à l'adresse
<a href="mailto:&#110;&#111;&#116;&#101;&#107;&#102;&#101;&#116;&#50;&#48;&#50;&#48;&commat;&#108;&#105;&#115;&#116;&#115;&period;&#99;&#114;&#97;&#110;&#115;&period;&#111;&#114;&#103;"> <a href="mailto:&#110;&#111;&#116;&#101;&#107;&#102;&#101;&#116;&#50;&#48;&#50;&#48;&commat;&#108;&#105;&#115;&#116;&#115;&period;&#99;&#114;&#97;&#110;&#115;&period;&#111;&#114;&#103;">

View File

@ -10,10 +10,9 @@ SPDX-License-Identifier: GPL-2.0-or-later
{% block content %} {% block content %}
{% if user.is_authenticated %} {% if user.is_authenticated %}
<p class="errornote"> <p class="errornote">
{% blocktrans trimmed with username=request.user.username %} {% blocktrans trimmed %}
You are authenticated as {{ username }}, but are not authorized to You are authenticated as {{ username }}, but are not authorized to
access this page. Would you like to login to a different account, access this page. Would you like to login to a different account?
or with a higher permission mask?
{% endblocktrans %} {% endblocktrans %}
</p> </p>
{% endif %} {% endif %}