Projet

Général

Profil

0001-provisionning-prevent-ValueError-on-a-user.roles.cle.patch

Benjamin Dauvergne, 03 juillet 2018 00:45

Télécharger (1,08 ko)

Voir les différences:

Subject: [PATCH] provisionning: prevent ValueError on a user.roles.clear()
 (fixes #24949)

 hobo/agent/authentic2/provisionning.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hobo/agent/authentic2/provisionning.py
350 350
            return
351 351
        if sender is self.Role.members.through:
352 352
            self.saved(instance)
353
            for other_instance in model.objects.filter(pk__in=pk_set):
353
            # on a clear, pk_set is None
354
            for other_instance in model.objects.filter(pk__in=pk_set or []):
354 355
                self.saved(other_instance)
355 356
            if action == 'pre_clear':
356 357
                # when the action is pre_clear we need to lookup the current value of the members
357
-