Skip to content

Commit

Permalink
Migrate permissions models to the new app
Browse files Browse the repository at this point in the history
  • Loading branch information
matti-lamppu committed Sep 27, 2024
1 parent 88d9922 commit 710aba5
Show file tree
Hide file tree
Showing 68 changed files with 524 additions and 292 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@

from django.contrib.auth.models import Group, Permission

from permissions.enums import UserRoleChoice
from permissions.models import GeneralRole, UnitRole
from tilavarauspalvelu.models import Unit, UnitGroup, User
from tilavarauspalvelu.enums import UserRoleChoice
from tilavarauspalvelu.models import GeneralRole, Unit, UnitGroup, UnitRole, User

from .utils import with_logs

Expand Down
3 changes: 1 addition & 2 deletions common/management/commands/data_creation/create_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

from django.contrib.auth.hashers import make_password

from permissions.enums import UserRoleChoice
from tilavarauspalvelu.enums import ReservationNotification
from tilavarauspalvelu.enums import ReservationNotification, UserRoleChoice
from tilavarauspalvelu.models import User

from .utils import with_logs
Expand Down
95 changes: 47 additions & 48 deletions locale/fi/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -1497,53 +1497,6 @@ msgstr "Siivoustauko/huoltotauko"
msgid "`start_datetime` must be before `end_datetime`."
msgstr "`start_datetime` täytyy olla ennen `end_datetime`."

#: permissions/admin/general_role.py
msgid "Search by username, email, first name or last name"
msgstr "Etsi käyttäjänimellä, sähköpostilla, etu- tai sukunimellä"

#: permissions/admin/unit_role.py
msgid ""
"Search by user's username, email, first name, last name, unit or unit group"
msgstr ""
"Etsi käyttäjänimellä, sähköpostilla, etu- tai sukunimellä, toimipisteellä "
"tai yksikköryhmällä"

#: permissions/enums.py
msgid "Admin"
msgstr "Pääkäyttäjä"

#: permissions/enums.py
msgid "Handler"
msgstr "Käsittelijä"

#: permissions/enums.py
msgid "Viewer"
msgstr "Katselija"

#: permissions/enums.py
msgid "Reserver"
msgstr "Varaaja"

#: permissions/enums.py
msgid "Notification manager"
msgstr "Ilmoituksen hallitsija."

#: permissions/models/general_role.py
msgid "General role"
msgstr "Yleinen rooli"

#: permissions/models/general_role.py
msgid "General roles"
msgstr "Yleiset roolit"

#: permissions/models/unit_role.py
msgid "Unit role"
msgstr "Toimipistekohtainen rooli"

#: permissions/models/unit_role.py
msgid "Unit roles"
msgstr "Toimipistekohtaiset roolit"

#: reservation_units/admin/reservation_unit/admin.py
msgid "Search by ID, name, unit name, or service sector name"
msgstr "Etsi ID:llä, nimellä, toimipisteen nimellä tai palvelualueen nimellä"
Expand Down Expand Up @@ -2883,6 +2836,10 @@ msgstr "Ei, vie minut takaisin"
msgid "Reset allocations"
msgstr "Nollaa allokoinnit"

#: tilavarauspalvelu/admin/general_role/admin.py
msgid "Search by username, email, first name or last name"
msgstr "Etsi käyttäjänimellä, sähköpostilla, etu- tai sukunimellä"

#: tilavarauspalvelu/admin/payment_merchant/admin.py
msgid "The Paytrail Merchant ID should be a six-digit number."
msgstr "Kaupan paytrail-tunnuksen tulisi olla kuusinumeroinen."
Expand Down Expand Up @@ -3015,6 +2972,13 @@ msgstr "Etsi nimellä tai TPREK ID:llä"
msgid "Search by name"
msgstr "Etsi nimellä"

#: tilavarauspalvelu/admin/unit_role/admin.py
msgid ""
"Search by user's username, email, first name, last name, unit or unit group"
msgstr ""
"Etsi käyttäjänimellä, sähköpostilla, etu- tai sukunimellä, toimipisteellä "
"tai yksikköryhmällä"

#: tilavarauspalvelu/api/gdpr/views.py
msgid "User has upcoming or too recent reservations."
msgstr "Käyttäjällä on tulevia tai liian äskettäisiä varauksia."
Expand Down Expand Up @@ -3104,7 +3068,6 @@ msgid "Free"
msgstr "Maksuton"

#: tilavarauspalvelu/enums.py

msgctxt "ResourceLocationType"
msgid "Fixed"
msgstr "Kiinteä"
Expand All @@ -3114,6 +3077,34 @@ msgctxt "ResourceLocationType"
msgid "Movable"
msgstr "Siirrettävä"

#: tilavarauspalvelu/enums.py
msgid "Admin"
msgstr "Pääkäyttäjä"

#: tilavarauspalvelu/enums.py
msgid "Handler"
msgstr "Käsittelijä"

#: tilavarauspalvelu/enums.py
msgid "Viewer"
msgstr "Katselija"

#: tilavarauspalvelu/enums.py
msgid "Reserver"
msgstr "Varaaja"

#: tilavarauspalvelu/enums.py
msgid "Notification manager"
msgstr "Ilmoituksen hallitsija."

#: tilavarauspalvelu/models/general_role/model.py
msgid "General role"
msgstr "Yleinen rooli"

#: tilavarauspalvelu/models/general_role/model.py
msgid "General roles"
msgstr "Yleiset roolit"

#: tilavarauspalvelu/models/payment_accounting/model.py
msgid ""
"One of the following fields must be given: internal_order, profit_center, "
Expand Down Expand Up @@ -3144,6 +3135,14 @@ msgctxt "plural"
msgid "terms of use"
msgstr "Käyttöehdot"

#: tilavarauspalvelu/models/unit_role/model.py
msgid "Unit role"
msgstr "Toimipistekohtainen rooli"

#: tilavarauspalvelu/models/unit_role/model.py
msgid "Unit roles"
msgstr "Toimipistekohtaiset roolit"

#: users/admin/user.py
msgid "Search by Username, First name, Last name or Email"
msgstr "Etsi käyttäjänimellä, etunimellä, sukunimellä tai sähköpostilla"
Expand Down
90 changes: 45 additions & 45 deletions locale/sv/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -1447,51 +1447,6 @@ msgstr ""
msgid "`start_datetime` must be before `end_datetime`."
msgstr ""

#: permissions/admin/general_role.py
msgid "Search by username, email, first name or last name"
msgstr ""

#: permissions/admin/unit_role.py
msgid ""
"Search by user's username, email, first name, last name, unit or unit group"
msgstr ""

#: permissions/enums.py
msgid "Admin"
msgstr ""

#: permissions/enums.py
msgid "Handler"
msgstr ""

#: permissions/enums.py
msgid "Viewer"
msgstr ""

#: permissions/enums.py
msgid "Reserver"
msgstr ""

#: permissions/enums.py
msgid "Notification manager"
msgstr ""

#: permissions/models/general_role.py
msgid "General role"
msgstr ""

#: permissions/models/general_role.py
msgid "General roles"
msgstr ""

#: permissions/models/unit_role.py
msgid "Unit role"
msgstr ""

#: permissions/models/unit_role.py
msgid "Unit roles"
msgstr ""

#: reservation_units/admin/reservation_unit/admin.py
msgid "Search by ID, name, unit name, or service sector name"
msgstr ""
Expand Down Expand Up @@ -2845,6 +2800,10 @@ msgstr ""
msgid "Reset allocations"
msgstr ""

#: tilavarauspalvelu/admin/general_role/admin.py
msgid "Search by username, email, first name or last name"
msgstr ""

#: tilavarauspalvelu/admin/payment_merchant/admin.py
msgid "The Paytrail Merchant ID should be a six-digit number."
msgstr ""
Expand Down Expand Up @@ -2979,6 +2938,11 @@ msgstr ""
msgid "Search by name"
msgstr ""

#: tilavarauspalvelu/admin/unit_role/admin.py
msgid ""
"Search by user's username, email, first name, last name, unit or unit group"
msgstr ""

#: tilavarauspalvelu/api/gdpr/views.py
msgid "User has upcoming or too recent reservations."
msgstr ""
Expand Down Expand Up @@ -3075,6 +3039,34 @@ msgctxt "ResourceLocationType"
msgid "Movable"
msgstr ""

#: tilavarauspalvelu/enums.py
msgid "Admin"
msgstr ""

#: tilavarauspalvelu/enums.py
msgid "Handler"
msgstr ""

#: tilavarauspalvelu/enums.py
msgid "Viewer"
msgstr ""

#: tilavarauspalvelu/enums.py
msgid "Reserver"
msgstr ""

#: tilavarauspalvelu/enums.py
msgid "Notification manager"
msgstr ""

#: tilavarauspalvelu/models/general_role/model.py
msgid "General role"
msgstr ""

#: tilavarauspalvelu/models/general_role/model.py
msgid "General roles"
msgstr ""

#: tilavarauspalvelu/models/payment_accounting/model.py
msgid ""
"One of the following fields must be given: internal_order, profit_center, "
Expand Down Expand Up @@ -3103,6 +3095,14 @@ msgctxt "plural"
msgid "terms of use"
msgstr ""

#: tilavarauspalvelu/models/unit_role/model.py
msgid "Unit role"
msgstr ""

#: tilavarauspalvelu/models/unit_role/model.py
msgid "Unit roles"
msgstr ""

#: users/admin/user.py
msgid "Search by Username, First name, Last name or Email"
msgstr ""
Expand Down
7 changes: 0 additions & 7 deletions permissions/admin/__init__.py

This file was deleted.

Loading

0 comments on commit 710aba5

Please sign in to comment.