Project

Profile

Help

Issue #8405

closed

pulp_container.app.registry_api.VersionView.permission_classes is a property and drf doesn't like that

Added by alikins about 3 years ago. Updated about 3 years ago.

Status:
CLOSED - NOTABUG
Priority:
Normal
Assignee:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Platform Release:
OS:
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
GalaxyNG
Sprint:
Quarter:

Description

Writing a galaxy_ng management command that pokes at the views and their permission classes and ran into:

DEBUG 2021-03-15 18:15:00,405 galaxy_ng.app.management.commands.access-policy-views access-policy-views.handle:154   713 - func.cls: <class 'pulp_container.app.registry_api.VersionView'>
DEBUG 2021-03-15 18:15:00,405 galaxy_ng.app.management.commands.access-policy-views access-policy-views.handle:155   713 - func.cls.permission_classes: <property object at 0x7f3d01eaeb38>
Traceback (most recent call last):
  File "/venv/bin/pulpcore-manager", line 33, in <module>
    sys.exit(load_entry_point('pulpcore', 'console_scripts', 'pulpcore-manager')())
  File "/src/pulpcore/pulpcore/app/manage.py", line 11, in manage
    execute_from_command_line(sys.argv)
  File "/venv/lib64/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "/venv/lib64/python3.6/site-packages/django/core/management/__init__.py", line 375, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/venv/lib64/python3.6/site-packages/django/core/management/base.py", line 323, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/venv/lib64/python3.6/site-packages/django/core/management/base.py", line 364, in execute
    output = self.handle(*args, **options)
  File "/src/galaxy_ng/galaxy_ng/app/management/commands/access-policy-views.py", line 158, in handle
    perms = func.cls.get_permissions(func.cls)
  File "/venv/lib64/python3.6/site-packages/rest_framework/views.py", line 278, in get_permissions
    return [permission() for permission in self.permission_classes]
TypeError: 'property' object is not iterable

Also available in: Atom PDF