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

django admin broken after 4.2 upgrade #5628

Closed
devincowan opened this issue Oct 23, 2024 · 0 comments · Fixed by #5629
Closed

django admin broken after 4.2 upgrade #5628

devincowan opened this issue Oct 23, 2024 · 0 comments · Fixed by #5629
Assignees
Labels
bug Broad category when more specific Label can't be found Critical Dashboard

Comments

@devincowan
Copy link
Contributor

devincowan commented Oct 23, 2024

Our django admin is broken as of hs 2.15.8

See this issue:
stephenmcd/mezzanine#2054

Internal Server Error: /admin/theme/siteconfiguration/1/change/
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.9/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/lib/python3.9/site-packages/django/contrib/admin/options.py", line 688, in wrapper
    return self.admin_site.admin_view(view)(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/django/utils/decorators.py", line 134, in _wrapper_view
    response = view_func(request, *args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/django/views/decorators/cache.py", line 62, in _wrapper_view_func
    response = view_func(request, *args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/django/contrib/admin/sites.py", line 242, in inner
    return view(request, *args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/mezzanine/utils/admin.py", line 60, in change_view
    response = super().change_view(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/django/contrib/admin/options.py", line 1889, in change_view
    return self.changeform_view(request, object_id, form_url, extra_context)
  File "/usr/local/lib/python3.9/site-packages/django/utils/decorators.py", line 46, in _wrapper
    return bound_method(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/django/utils/decorators.py", line 134, in _wrapper_view
    response = view_func(request, *args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/django/contrib/admin/options.py", line 1747, in changeform_view
    return self._changeform_view(request, object_id, form_url, extra_context)
  File "/usr/local/lib/python3.9/site-packages/django/contrib/admin/options.py", line 1792, in _changeform_view
    form_validated = form.is_valid()
  File "/usr/local/lib/python3.9/site-packages/django/forms/forms.py", line 201, in is_valid
    return self.is_bound and not self.errors
  File "/usr/local/lib/python3.9/site-packages/django/forms/forms.py", line 196, in errors
    self.full_clean()
  File "/usr/local/lib/python3.9/site-packages/django/forms/forms.py", line 435, in full_clean
    self._post_clean()
  File "/usr/local/lib/python3.9/site-packages/django/forms/models.py", line 486, in _post_clean
    self.instance.full_clean(exclude=exclude, validate_unique=False)
  File "/usr/local/lib/python3.9/site-packages/django/db/models/base.py", line 1470, in full_clean
    self.clean_fields(exclude=exclude)
  File "/usr/local/lib/python3.9/site-packages/django/db/models/base.py", line 1522, in clean_fields
    setattr(self, f.attname, f.clean(raw_value, self))
  File "/usr/local/lib/python3.9/site-packages/mezzanine/core/fields.py", line 54, in clean
    return escape(value)
  File "/usr/local/lib/python3.9/site-packages/mezzanine/utils/deprecation.py", line 71, in wrapper
    return django_safe(s(*args, **kwargs))
  File "/usr/local/lib/python3.9/site-packages/mezzanine/utils/html.py", line 113, in escape
    protocols=ALLOWED_PROTOCOLS + ["tel"],
TypeError: unsupported operand type(s) for +: 'frozenset' and 'list'

Looks like this needs to be updated to:
protocols=list(ALLOWED_PROTOCOLS) + ["tel"],

Or possibly, we need to downgrade Bleach from 6.1.0 to bleach==5.0.1

@devincowan devincowan added bug Broad category when more specific Label can't be found Dashboard labels Oct 23, 2024
@devincowan devincowan moved this from Backlog to Selected Next for Development in HydroShare Issue Management Board Oct 23, 2024
@devincowan devincowan self-assigned this Oct 23, 2024
@devincowan devincowan moved this from Selected Next for Development to In Progress in HydroShare Issue Management Board Oct 23, 2024
@devincowan devincowan mentioned this issue Oct 23, 2024
5 tasks
@devincowan devincowan moved this from In Progress to In Review in HydroShare Issue Management Board Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Broad category when more specific Label can't be found Critical Dashboard
Projects
Development

Successfully merging a pull request may close this issue.

1 participant