Closed neic closed 5 years ago
Med title_set-0-period = '18' fra ProfileTitleAdmin fejler tktitler._validate("…", "18").
title_set-0-period = '18'
ProfileTitleAdmin
tktitler._validate("…", "18")
Internal Server Error: /admin/idm/profile/add/ ValueError at /admin/idm/profile/add/ '18' is not a valid period […] Traceback: File "/home/tkammer/tkweb/.venv/lib/python3.5/site-packages/django/core/handlers/exception.py" in inner 41. response = get_response(request) File "/home/tkammer/tkweb/.venv/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response 187. response = self.process_exception_by_middleware(e, request) File "/home/tkammer/tkweb/.venv/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response 185. response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/home/tkammer/tkweb/.venv/lib/python3.5/site-packages/django/contrib/admin/options.py" in wrapper 552. return self.admin_site.admin_view(view)(*args, **kwargs) File "/home/tkammer/tkweb/.venv/lib/python3.5/site-packages/django/utils/decorators.py" in _wrapped_view 149. response = view_func(request, *args, **kwargs) File "/home/tkammer/tkweb/.venv/lib/python3.5/site-packages/django/views/decorators/cache.py" in _wrapped_view_func 57. response = view_func(request, *args, **kwargs) File "/home/tkammer/tkweb/.venv/lib/python3.5/site-packages/django/contrib/admin/sites.py" in inner 224. return view(request, *args, **kwargs) File "/home/tkammer/tkweb/.venv/lib/python3.5/site-packages/django/contrib/admin/options.py" in add_view 1509. return self.changeform_view(request, None, form_url, extra_context) File "/home/tkammer/tkweb/.venv/lib/python3.5/site-packages/django/utils/decorators.py" in _wrapper 67. return bound_func(*args, **kwargs) File "/home/tkammer/tkweb/.venv/lib/python3.5/site-packages/django/utils/decorators.py" in _wrapped_view 149. response = view_func(request, *args, **kwargs) File "/home/tkammer/tkweb/.venv/lib/python3.5/site-packages/django/utils/decorators.py" in bound_func 63. return func.__get__(self, type(self))(*args2, **kwargs2) File "/home/tkammer/tkweb/.venv/lib/python3.5/site-packages/django/contrib/admin/options.py" in changeform_view 1409. return self._changeform_view(request, object_id, form_url, extra_context) File "/home/tkammer/tkweb/.venv/lib/python3.5/site-packages/django/contrib/admin/options.py" in _changeform_view 1451. change_message = self.construct_change_message(request, form, formsets, add) File "/home/tkammer/tkweb/.venv/lib/python3.5/site-packages/django/contrib/admin/options.py" in construct_change_message 942. return construct_change_message(form, formsets, add) File "/home/tkammer/tkweb/.venv/lib/python3.5/site-packages/django/contrib/admin/utils.py" in construct_change_message 526. 'object': force_text(added_object), File "/home/tkammer/tkweb/.venv/lib/python3.5/site-packages/django/utils/encoding.py" in force_text 76. s = six.text_type(s) File "/home/tkammer/tkweb/.venv/lib/python3.5/site-packages/tktitler.py" in wrapped 85. return fun(*args, **kwargs) File "/home/tkammer/tkweb/tkweb/apps/idm/models.py" in __str__ 127. return '%s %s' % (tk.prefix(self, type='unicode'), getattr(self, 'profile', '')) File "/home/tkammer/tkweb/.venv/lib/python3.5/site-packages/tktitler.py" in prefix 180. (root, period), gfyear = _validate(title, gfyear) File "/home/tkammer/tkweb/.venv/lib/python3.5/site-packages/tktitler.py" in _validate 658. title = _validate_title(title) File "/home/tkammer/tkweb/.venv/lib/python3.5/site-packages/tktitler.py" in _validate_title 653. raise ValueError("\'%s\' is not a valid period" % period) Exception Type: ValueError at /admin/idm/profile/add/ Exception Value: '18' is not a valid period Request information: USER: <REDACTED> GET: No GET data POST: title_set-__prefix__-profile = '' title_set-__prefix__-kind = '' house_number = '' groups = '3' title_set-2-root = '' title_set-1-root = '' title_set-MAX_NUM_FORMS = '1000' town = '' title_set-1-kind = '' title_set-0-root = '<REDACTED>' street_name = '' title_set-0-profile = '' title_set-__prefix__-root = '' title_set-2-kind = '' _addanother = 'Gem og tilføj endnu en' title_set-2-period = '' title_set-MIN_NUM_FORMS = '0' postal_code = '' note = '' title_set-INITIAL_FORMS = '0' title_set-0-kind = 'FU' title_set-__prefix__-id = '' country = '' name = '<REDACTED>' title_set-1-profile = '' title_set-0-id = '' title_set-0-period = '18' title_set-__prefix__-period = '' title_set-1-period = '' title_set-2-id = '' title_set-2-profile = '' csrfmiddlewaretoken = '<REDACTED>' title_set-TOTAL_FORMS = '3' email = '<REDACTED>' phone_number = '<REDACTED>' allow_direct_email = 'on' title_set-1-id = '' […]
Se også #230
Med
title_set-0-period = '18'
fraProfileTitleAdmin
fejlertktitler._validate("…", "18")
.