Projet

Général

Profil

Bug #50871

pas d'envoi de message au demandeur quand le mail de celui-ci est dans un bloc de champ

Ajouté par Thomas Noël il y a environ 3 ans. Mis à jour il y a environ 3 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
Version cible:
-
Début:
04 février 2021
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Oui
Planning:
Non

Description

Sur une demande anonyme, le mail considéré est le premier champ courriel pré-rempli par le courriel du profil usager.

Ca ne marche pas si ce champ est en fait dans un bloc.


Fichiers

Révisions associées

Révision 26085c11 (diff)
Ajouté par Lauréline Guérin il y a environ 3 ans

workflow: fix get_submitter_email with blockdef (#50871)

Historique

#1

Mis à jour par Thomas Noël il y a environ 3 ans

C'est dans wcs/formdef.py que le calcul du mail est fait, et on ne tient compte que des formdata.formdef.fields :

    def get_submitter_email(self, formdata):
        users_cfg = get_cfg('users', {})
        field_email = users_cfg.get('field_email') or 'email'

        # look up in submitted form for one that would hold the user
        # email (the one set to be prefilled by user email)
        if formdata.data:
            fields = formdata.formdef.fields
            for field in fields:
                if not hasattr(field, 'prefill'):
                    continue
                if field.prefill and field.prefill.get('type') == 'user':
                    if field.prefill.get('value') == field_email:
                        v = formdata.data.get(field.id)
                        if v:
                            return v

        # if nothing was found, get email from user profile
        if formdata.user and formdata.user.email and formdata.user.is_active:
            return formdata.user.email

        return None
#3

Mis à jour par Pierre Cros il y a environ 3 ans

Relance de Toulouse sur le sujet à l'instant

#5

Mis à jour par Lauréline Guérin il y a environ 3 ans

  • Assigné à mis à Lauréline Guérin
#6

Mis à jour par Lauréline Guérin il y a environ 3 ans

#8

Mis à jour par Frédéric Péters il y a environ 3 ans

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

Mis à jour par Lauréline Guérin il y a environ 3 ans

  • Statut changé de Solution validée à Résolu (à déployer)
commit 26085c11906fd575d46f19519869c1afe51897ea
Author: Lauréline Guérin <zebuline@entrouvert.com>
Date:   Mon Apr 12 14:42:36 2021 +0200

    workflow: fix get_submitter_email with blockdef (#50871)
#10

Mis à jour par Frédéric Péters il y a environ 3 ans

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

Mis à jour par Benjamin Dauvergne il y a environ 3 ans

  • Statut changé de Solution déployée à En cours

Il y a encore des erreurs de ce type j'ai l'impression, https://sentry.entrouvert.org/entrouvert/nfrance/issues/43507/ il y 6 minutes.

#12

Mis à jour par Frédéric Péters il y a environ 3 ans

  • Statut changé de En cours à Solution déployée

C'est éventuellement un bug dans le nouveau code, ça va plutôt dans un nouveau ticket, je m'en occupe.

Formats disponibles : Atom PDF