You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm trying to clone a template that has a pretty long title (62 characters) but if I clone it, the new cloned template will have an added prefix (Clone) to it which makes it goes over the limit of 64 characters, resulted in Django error
==> openwisp2.log <==
[ERROR 2023-07-24 03:13:47,346] module: log, process: 862367, thread: 140614550849344
Internal Server Error: /admin/config/template/
Traceback (most recent call last):
File "/opt/openwisp2/env/lib/python3.9/site-packages/django/core/handlers/exception.py", line 56, in inner
response = get_response(request)
File "/opt/openwisp2/env/lib/python3.9/site-packages/django/core/handlers/base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/opt/openwisp2/env/lib/python3.9/site-packages/django/contrib/admin/options.py", line 683, in wrapper
return self.admin_site.admin_view(view)(*args, **kwargs)
File "/opt/openwisp2/env/lib/python3.9/site-packages/django/utils/decorators.py", line 134, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "/opt/openwisp2/env/lib/python3.9/site-packages/django/views/decorators/cache.py", line 62, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
File "/opt/openwisp2/env/lib/python3.9/site-packages/django/contrib/admin/sites.py", line 242, in inner
return view(request, *args, **kwargs)
File "/opt/openwisp2/env/lib/python3.9/site-packages/reversion/admin.py", line 235, in changelist_view
return super().changelist_view(request, context)
File "/opt/openwisp2/env/lib/python3.9/site-packages/django/utils/decorators.py", line 46, in _wrapper
return bound_method(*args, **kwargs)
File "/opt/openwisp2/env/lib/python3.9/site-packages/django/utils/decorators.py", line 134, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "/opt/openwisp2/env/lib/python3.9/site-packages/django/contrib/admin/options.py", line 1984, in changelist_view
response = self.response_action(
File "/opt/openwisp2/env/lib/python3.9/site-packages/django/contrib/admin/options.py", line 1589, in response_action
response = func(self, request, queryset)
File "/opt/openwisp2/env/lib/python3.9/site-packages/openwisp_controller/config/admin.py", line 685, in clone_selected_templates
clone = template.clone(user)
File "/opt/openwisp2/env/lib/python3.9/site-packages/openwisp_controller/config/base/template.py", line 208, in clone
clone.full_clean()
File "/opt/openwisp2/env/lib/python3.9/site-packages/django/db/models/base.py", line 1405, in full_clean
raise ValidationError(errors)
django.core.exceptions.ValidationError: {'name': ['Ensure this value has at most 64 characters (it has 68).']}
I think we should have this exception caught and return an error message instead of spitting out 500.
The text was updated successfully, but these errors were encountered:
@minhng99 if you could try again with the latest master and let us know if the issue persists, it would be useful, as we did some changes to this recently and it may have been fixed.
Hi, I'm trying to clone a template that has a pretty long title (62 characters) but if I clone it, the new cloned template will have an added prefix
(Clone)
to it which makes it goes over the limit of 64 characters, resulted in Django errorI think we should have this exception caught and return an error message instead of spitting out
500
.The text was updated successfully, but these errors were encountered: