Projet

Général

Profil

Bug #75715

pdf: ne pas afficher le bouton vers l'édition de la correspondance des champs s'il n'y a pas de fichier modèle associé

Ajouté par Serghei Mihai il y a environ un an. Mis à jour il y a environ un an.

Statut:
Fermé
Priorité:
Normal
Assigné à:
Version cible:
-
Début:
22 mars 2023
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Non
Planning:
Non

Description

Lorsqu'on clique sur le bouton on se prend une erreur 500:

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.

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

Révisions associées

Révision aa24d04f (diff)
Ajouté par Serghei Mihai il y a environ un an

pdf: do not display form's fill page if no pdf file associated (#75715)

Historique

#1

Mis à jour par Serghei Mihai il y a environ un an

  • Description mis à jour (diff)
#2

Mis à jour par Robot Gitea il y a environ un an

  • Statut changé de Nouveau à Solution proposée
  • Assigné à mis à Serghei Mihai

Serghei Mihai (smihai) a ouvert une pull request sur Gitea concernant cette demande :

#3

Mis à jour par Robot Gitea il y a environ un an

  • Statut changé de Solution proposée à Solution validée

Thomas NOËL (tnoel) a approuvé une pull request sur Gitea concernant cette demande :

#4

Mis à jour par Robot Gitea il y a environ un an

  • Statut changé de Solution validée à Résolu (à déployer)

Serghei Mihai (smihai) a mergé une pull request sur Gitea concernant cette demande :

#5

Mis à jour par Transition automatique il y a environ un an

  • Statut changé de Résolu (à déployer) à Solution déployée
#6

Mis à jour par Transition automatique il y a 11 mois

Automatic expiration

Formats disponibles : Atom PDF