Projet

Général

Profil

Development #30091

Trace export utilisateur csv - problème de version Tablib

Ajouté par Emmanuel Cazenave il y a plus de 5 ans. Mis à jour il y a environ 5 ans.

Statut:
Fermé
Priorité:
Haut
Assigné à:
Catégorie:
-
Version cible:
-
Début:
25 janvier 2019
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Oui
Planning:

Description

En prod :

AttributeError at /manage/users/export/csv/

'Dataset' object has no attribute 'export'

Fichiers

Révisions associées

Révision c7f80a61 (diff)
Ajouté par Emmanuel Cazenave il y a plus de 5 ans

user export csv compatiblity with tablib < 0.11 (#30091)

Historique

#1

Mis à jour par Thomas Noël il y a plus de 5 ans

  • Statut changé de Nouveau à Rejeté

doublon de #30090

#2

Mis à jour par Emmanuel Cazenave il y a plus de 5 ans

La trace complète et le patch.

Internal Server Error: /manage/users/export/csv/
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python2.7/dist-packages/django/contrib/auth/decorators.py", line 22, in _wrapped_view
    return view_func(request, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/django/views/generic/base.py", line 71, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/authentic2/manager/views.py", line 126, in dispatch
    return super(PermissionMixin, self).dispatch(request, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/authentic2/manager/views.py", line 178, in dispatch
    return super(SearchFormMixin, self).dispatch(request, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/django/views/generic/base.py", line 89, in dispatch
    return handler(request, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/authentic2/manager/views.py", line 364, in get
    content = getattr(self.get_dataset(), export_format)
  File "/usr/lib/python2.7/dist-packages/authentic2/manager/user_views.py", line 345, in csv
    return self._dataset.export('csv')
AttributeError: 'Dataset' object has no attribute 'export'
#3

Mis à jour par Frédéric Péters il y a plus de 5 ans

Je mettrais le code à l'envers, pour avoir dans le if ... le code qui pourra un jour être supprimé, et un commentaire pour dire "cette branche est là pour gérer tablib < x.y".

#5

Mis à jour par Emmanuel Cazenave il y a plus de 5 ans

Et donc testé local avec tablib 0.9.11, et 0.12.1, ça m'a l'air ok.

#6

Mis à jour par Emmanuel Cazenave il y a plus de 5 ans

Déployé sur ancien SAAS uniquement, testé sur Fontenay, exception différente :

Internal Server Error: /manage/users/export/csv/
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python2.7/dist-packages/django/contrib/auth/decorators.py", line 22, in _wrapped_view
    return view_func(request, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/django/views/generic/base.py", line 71, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/authentic2/manager/views.py", line 126, in dispatch
    return super(PermissionMixin, self).dispatch(request, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/authentic2/manager/views.py", line 178, in dispatch
    return super(SearchFormMixin, self).dispatch(request, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/django/views/generic/base.py", line 89, in dispatch
    return handler(request, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/authentic2/manager/views.py", line 364, in get
    content = getattr(self.get_dataset(), export_format)
  File "/usr/lib/python2.7/dist-packages/authentic2/manager/user_views.py", line 361, in get_dataset
    user_attrs[av['object_id']][at_mapping[av['attribute_id']].name] = av['content']
KeyError: 5
#7

Mis à jour par Emmanuel Cazenave il y a plus de 5 ans

Mais rien à voir avec Tablib : #30103

#8

Mis à jour par Emmanuel Cazenave il y a plus de 5 ans

  • Sujet changé de Trace export utilisateur csv à Trace export utilisateur csv - problème de version Tablib
#9

Mis à jour par Serghei Mihai il y a environ 5 ans

  • Statut changé de Solution proposée à Solution déployée
  • Assigné à mis à Emmanuel Cazenave
#10

Mis à jour par Emmanuel Cazenave il y a environ 5 ans

  • Statut changé de Solution déployée à Résolu (à déployer)
commit c7f80a61d273c23dfc5d82c803f6ad55a23df4ca
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Fri Jan 25 11:42:49 2019 +0100

    user export csv compatiblity with tablib < 0.11 (#30091)
#11

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

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

Formats disponibles : Atom PDF