Projet

Général

Profil

Bug #75715

Mis à jour par Serghei Mihai (congés, retour 15/05) il y a environ un an

Lorsqu'on clique sur le bouton on se prend une erreur 500:
<pre>
Environment:

Request Method: GET
Request URL: https://passerelle.dev.publik.love/manage/pdf/test/fields-mapping/edit/

Django Version: 3.2.18
Python Version: 3.11.2
Installed Applications:
''
Installed Middleware:
''

Traceback (most recent call last):
File "/home/serghei/envs/publik-env-py3/lib/python3.11/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/home/serghei/envs/publik-env-py3/lib/python3.11/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/serghei/envs/publik-env-py3/lib/python3.11/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view
return view_func(request, *args, **kwargs)
File "/home/serghei/src/passerelle/passerelle/urls_utils.py", line 67, in f
return func(request, *args, **kwargs)
File "/home/serghei/envs/publik-env-py3/lib/python3.11/site-packages/django/views/generic/base.py", line 70, in view
return self.dispatch(request, *args, **kwargs)
File "/home/serghei/envs/publik-env-py3/lib/python3.11/site-packages/django/views/generic/base.py", line 98, in dispatch
return handler(request, *args, **kwargs)
File "/home/serghei/envs/publik-env-py3/lib/python3.11/site-packages/django/views/generic/detail.py", line 107, in get
context = self.get_context_data(object=self.object)
File "/home/serghei/src/passerelle/passerelle/apps/pdf/views.py", line 41, in get_context_data
pdf = PDF(fd)
File "/home/serghei/src/passerelle/passerelle/utils/pdf.py", line 335, in __init__
if hasattr(content, 'read'):
File "/home/serghei/envs/publik-env-py3/lib/python3.11/site-packages/django/core/files/utils.py", line 42, in <lambda>
read = property(lambda self: self.file.read)
File "/home/serghei/envs/publik-env-py3/lib/python3.11/site-packages/django/db/models/fields/files.py", line 43, in _get_file
self._require_file()
File "/home/serghei/envs/publik-env-py3/lib/python3.11/site-packages/django/db/models/fields/files.py", line 40, in _require_file
raise ValueError("The '%s' attribute has no file associated with it." % self.field.name)

Exception Type: ValueError at /manage/pdf/test/fields-mapping/edit/
Exception Value: The 'fill_form_file' attribute has no file associated with it.
</pre>

Il faut soit ne pas afficher le bouton, soit afficher un message d'erreur lorsqu'on clique dessus.

Retour