Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error message when attempting to add inactive users to pages #3323

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions integreat_cms/cms/views/pages/page_permission_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,11 @@ def grant_permission(self, user: User, page: Page) -> PermissionMessage:

:return: Response message
"""
if not user.is_active:
return PermissionMessage(
_("Inactive users cannot be assigned to pages."),
MessageLevel.WARNING,
)
if not user.has_perm("cms.view_page"):
return PermissionMessage(
_(
Expand Down
4 changes: 4 additions & 0 deletions integreat_cms/locale/de/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -10258,6 +10258,10 @@ msgid "An error has occurred. Please contact an administrator."
msgstr ""
"Ein Fehler ist aufgetreten. Bitte kontaktieren Sie eine:n Administrator:in."

#: cms/views/pages/page_permission_actions.py
msgid "Inactive users cannot be assigned to pages."
msgstr "Benutzer:innen können keiner Seite zugeordnet werden, solange ihr Nutzerkonto nicht aktiviert wurde."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
msgstr "Benutzer:innen können keiner Seite zugeordnet werden, solange ihr Nutzerkonto nicht aktiviert wurde."
msgstr "Benutzer:innen können keiner Seite zugeordnet werden, solange ihr Konto nicht aktiviert wurde."

Super nit pick: I think we usually use the gender neutral version and just say "Konto"


#: cms/views/pages/page_permission_actions.py
msgid ""
"Page-specific permissions cannot be granted to users who do not have "
Expand Down
Loading