Permission assign view doesn't work with GlobalPermissionModel
The permission assign view has problems with permissions from models which are not real in the database.
Traceback (most recent call last):
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django_prometheus/db/common.py", line 71, in execute
return super().execute(*args, **kwargs)
The above exception (FEHLER: Relation »chronos_chronosglobalpermissions« existiert nicht
LINE 1: ...LECT "chronos_chronosglobalpermissions"."id" FROM "chronos_c...
^
) was the direct cause of the following exception:
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1175, in execute_sql
cursor.execute(sql, params)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/cachalot/monkey_patch.py", line 129, in inner
return original(cursor, sql, *args, **kwargs)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/sentry_sdk/integrations/django/__init__.py", line 500, in execute
return real_execute(self, sql, params)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/db/backends/utils.py", line 66, in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/db/utils.py", line 90, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django_prometheus/db/common.py", line 71, in execute
return super().execute(*args, **kwargs)
During handling of the above exception (FEHLER: Relation »chronos_chronosglobalpermissions« existiert nicht
LINE 1: ...LECT "chronos_chronosglobalpermissions"."id" FROM "chronos_c...
^
), another exception occurred:
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/core/handlers/base.py", line 204, in _get_response
response = response.render()
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/template/response.py", line 105, in render
self.content = self.rendered_content
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/sentry_sdk/integrations/django/templates.py", line 73, in rendered_content
return real_rendered_content.fget(self)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/template/response.py", line 83, in rendered_content
return template.render(context, self._request)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/template/backends/django.py", line 61, in render
return self.template.render(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/template/base.py", line 170, in render
return self._render(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/test/utils.py", line 100, in instrumented_test_render
return self.nodelist.render(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/template/base.py", line 938, in render
bit = node.render_annotated(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/template/base.py", line 905, in render_annotated
return self.render(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/template/loader_tags.py", line 150, in render
return compiled_parent._render(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/test/utils.py", line 100, in instrumented_test_render
return self.nodelist.render(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/template/base.py", line 938, in render
bit = node.render_annotated(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/template/base.py", line 905, in render_annotated
return self.render(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/template/loader_tags.py", line 62, in render
result = block.nodelist.render(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/template/base.py", line 938, in render
bit = node.render_annotated(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/template/base.py", line 905, in render_annotated
return self.render(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/material/templatetags/material_form.py", line 142, in render
return template.render(context_flatten(context))
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/template/backends/django.py", line 61, in render
return self.template.render(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/template/base.py", line 170, in render
return self._render(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/test/utils.py", line 100, in instrumented_test_render
return self.nodelist.render(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/template/base.py", line 938, in render
bit = node.render_annotated(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/template/base.py", line 905, in render_annotated
return self.render(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/material/templatetags/material_form.py", line 203, in render
value = self.nodelist.render(context).strip()
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/template/base.py", line 938, in render
bit = node.render_annotated(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/template/base.py", line 905, in render_annotated
return self.render(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/template/defaulttags.py", line 312, in render
return nodelist.render(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/template/base.py", line 938, in render
bit = node.render_annotated(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/template/base.py", line 905, in render_annotated
return self.render(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/material/templatetags/material_form.py", line 203, in render
value = self.nodelist.render(context).strip()
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/template/base.py", line 938, in render
bit = node.render_annotated(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/template/base.py", line 905, in render_annotated
return self.render(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/material/templatetags/material_form_internal.py", line 92, in render
return element.render(context, **options)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/material/base.py", line 53, in render
return template.render(context.flatten())
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/template/backends/django.py", line 61, in render
return self.template.render(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/template/base.py", line 170, in render
return self._render(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/test/utils.py", line 100, in instrumented_test_render
return self.nodelist.render(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/template/base.py", line 938, in render
bit = node.render_annotated(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/template/base.py", line 905, in render_annotated
return self.render(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/template/defaulttags.py", line 211, in render
nodelist.append(node.render_annotated(context))
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/template/base.py", line 905, in render_annotated
return self.render(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/material/templatetags/material_form_internal.py", line 92, in render
return element.render(context, **options)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/material/base.py", line 53, in render
return template.render(context.flatten())
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/template/backends/django.py", line 61, in render
return self.template.render(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/template/base.py", line 170, in render
return self._render(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/test/utils.py", line 100, in instrumented_test_render
return self.nodelist.render(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/template/base.py", line 938, in render
bit = node.render_annotated(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/template/base.py", line 905, in render_annotated
return self.render(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/template/defaulttags.py", line 211, in render
nodelist.append(node.render_annotated(context))
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/template/base.py", line 905, in render_annotated
return self.render(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/material/templatetags/material_form_internal.py", line 92, in render
return element.render(context, **options)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/material/base.py", line 229, in render
return template.render(context.flatten())
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/template/backends/django.py", line 61, in render
return self.template.render(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/template/base.py", line 170, in render
return self._render(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/test/utils.py", line 100, in instrumented_test_render
return self.nodelist.render(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/template/base.py", line 938, in render
bit = node.render_annotated(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/template/base.py", line 905, in render_annotated
return self.render(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/material/templatetags/material_form_internal.py", line 78, in render
_render_parts(context, children)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/material/templatetags/material_form.py", line 31, in _render_parts
value = partnode.render(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/material/templatetags/material_form.py", line 203, in render
value = self.nodelist.render(context).strip()
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/template/base.py", line 938, in render
bit = node.render_annotated(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/template/base.py", line 905, in render_annotated
return self.render(context)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/template/defaulttags.py", line 163, in render
values = self.sequence.resolve(context, ignore_failures=True)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/template/base.py", line 698, in resolve
new_obj = func(obj, *arg_vals)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/material/templatetags/material_form_internal.py", line 216, in select_options
for option in bound_field.field.widget.choices:
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/forms/models.py", line 1169, in __iter__
for obj in queryset:
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/db/models/query.py", line 353, in _iterator
yield from self._iterable_class(self, chunked_fetch=use_chunked_fetch, chunk_size=chunk_size)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/db/models/query.py", line 51, in __iter__
results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/cachalot/monkey_patch.py", line 29, in inner
return original(compiler, *args, **kwargs)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/cachalot/monkey_patch.py", line 88, in inner
return _get_result_or_execute_query(
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/cachalot/monkey_patch.py", line 56, in _get_result_or_execute_query
result = execute_query_func()
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/cachalot/monkey_patch.py", line 72, in <lambda>
execute_query_func = lambda: original(compiler, *args, **kwargs)
File "/srv/aleksis/envs/production/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1178, in execute_sql
cursor.close()