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

fix: group_perms error with news admin #890

Merged
merged 1 commit into from
Oct 25, 2024

Conversation

wesleyboar
Copy link
Member

Overview

Fix error with group_perms command.

Logs

root@e4f873393b0c:/code# ./manage.py set_group_perms text_editor_basic text_editor_advanced media_editor_basic media_editor_advanced news_writer_basic news_writer_advanced
Traceback (most recent call last):
File "/code/./manage.py", line 22, in
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.11/site-packages/django/core/management/init.py", line 442, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.11/site-packages/django/core/management/init.py", line 436, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.11/site-packages/django/core/management/base.py", line 412, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.11/site-packages/django/core/management/base.py", line 458, in execute
output = self.handle(*args, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/code/taccsite_cms/management/commands/set_group_perms.py", line 28, in handle
mod.set_group_perms()
File "/code/taccsite_cms/management/commands/group_perms/news_writer_advanced.py", line 46, in set_group_perms
group.permissions.add( Permission.objects.get(name='Can add Tag') )
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/django/db/models/manager.py", line 87, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/django/db/models/query.py", line 637, in get
raise self.model.DoesNotExist(
django.contrib.auth.models.Permission.DoesNotExist: Permission matching query does not exist.

Related

N/A

Changes

  • changed name of invalid permission
    Maybe since update of djangocms-blog… uncertain.

Testing

  1. Have no user Groups.
  2. Run ./manage.py set_group_perms text_editor_basic text_editor_advanced media_editor_basic media_editor_advanced news_writer_basic news_writer_advanced.
  3. Expect no error.

UI

N/A

@wesleyboar wesleyboar merged commit 59c0d99 into main Oct 25, 2024
@wesleyboar wesleyboar deleted the fix/groups_perms-manage-command-failure branch October 25, 2024 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant