Development #46563
django_journal: Journal has no field named 'user'
Début:
11 septembre 2020
Echéance:
% réalisé:
0%
Temps estimé:
Patch proposed:
Oui
Planning:
Non
Description
En me rendant sur /admin/django_journal/journal/ :
sept. 11 09:56:24 pw uwsgi[23480]: docbow(pid=23480) ERROR 2020-09-11 09:56:24,984t_140360421955456 docbow: Internal Server Error: /admin/django_journal/journal/ Traceback (most recent call last): File "/usr/lib/python3/dist-packages/django/db/models/options.py", line 617, in get_field return self.fields_map[field_name] KeyError: 'user' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/django/contrib/admin/utils.py", line 283, in lookup_field f = _get_non_gfk_field(opts, name) File "/usr/lib/python3/dist-packages/django/contrib/admin/utils.py", line 317, in _get_non_gfk_field field = opts.get_field(name) File "/usr/lib/python3/dist-packages/django/db/models/options.py", line 619, in get_field raise FieldDoesNotExist("%s has no field named '%s'" % (self.object_name, field_name)) django.core.exceptions.FieldDoesNotExist: Journal has no field named 'user' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/django/core/handlers/base.py", line 215, in _get_response response = response.render() File "/usr/lib/python3/dist-packages/django/template/response.py", line 107, in render self.content = self.rendered_content File "/usr/lib/python3/dist-packages/django/template/response.py", line 84, in rendered_content content = template.render(context, self._request) File "/usr/lib/python3/dist-packages/django/template/backends/django.py", line 66, in render return self.template.render(context) File "/usr/lib/python3/dist-packages/django/template/base.py", line 207, in render return self._render(context) File "/usr/lib/python3/dist-packages/django/template/base.py", line 199, in _render return self.nodelist.render(context) File "/usr/lib/python3/dist-packages/django/template/base.py", line 990, in render bit = node.render_annotated(context) File "/usr/lib/python3/dist-packages/django/template/base.py", line 957, in render_annotated return self.render(context) File "/usr/lib/python3/dist-packages/django/template/loader_tags.py", line 177, in render return compiled_parent._render(context) File "/usr/lib/python3/dist-packages/django/template/base.py", line 199, in _render return self.nodelist.render(context) File "/usr/lib/python3/dist-packages/django/template/base.py", line 990, in render bit = node.render_annotated(context) File "/usr/lib/python3/dist-packages/django/template/base.py", line 957, in render_annotated return self.render(context) File "/usr/lib/python3/dist-packages/django/template/loader_tags.py", line 177, in render return compiled_parent._render(context) File "/usr/lib/python3/dist-packages/django/template/base.py", line 199, in _render return self.nodelist.render(context) File "/usr/lib/python3/dist-packages/django/template/base.py", line 990, in render bit = node.render_annotated(context) File "/usr/lib/python3/dist-packages/django/template/base.py", line 957, in render_annotated return self.render(context) File "/usr/lib/python3/dist-packages/django/template/loader_tags.py", line 72, in render result = block.nodelist.render(context) File "/usr/lib/python3/dist-packages/django/template/base.py", line 990, in render bit = node.render_annotated(context) File "/usr/lib/python3/dist-packages/django/template/base.py", line 957, in render_annotated return self.render(context) File "/usr/lib/python3/dist-packages/django/template/loader_tags.py", line 72, in render result = block.nodelist.render(context) File "/usr/lib/python3/dist-packages/django/template/base.py", line 990, in render bit = node.render_annotated(context) File "/usr/lib/python3/dist-packages/django/template/base.py", line 957, in render_annotated return self.render(context) File "/usr/lib/python3/dist-packages/django/template/library.py", line 225, in render _dict = self.func(*resolved_args, **resolved_kwargs) File "/usr/lib/python3/dist-packages/django/contrib/admin/templatetags/admin_list.py", line 340, in result_list 'results': list(results(cl))} File "/usr/lib/python3/dist-packages/django/contrib/admin/templatetags/admin_list.py", line 316, in results yield ResultList(None, items_for_result(cl, res, None)) File "/usr/lib/python3/dist-packages/django/contrib/admin/templatetags/admin_list.py", line 307, in __init__ super(ResultList, self).__init__(*items) File "/usr/lib/python3/dist-packages/django/contrib/admin/templatetags/admin_list.py", line 218, in items_for_result f, attr, value = lookup_field(field_name, result, cl.model_admin) File "/usr/lib/python3/dist-packages/django/contrib/admin/utils.py", line 295, in lookup_field value = attr(obj) File "/usr/lib/python3/dist-packages/docbow_project/docbow/admin.py", line 265, in user user = self.object_filter_link(objectdata) + \ File "/usr/lib/python3.5/dist-packages/django_journal/admin.py", line 122, in object_filter_link caption = unicode(objectdata.content_object) NameError: name 'unicode' is not defined
Fichiers
Révisions associées
Historique
Mis à jour par Emmanuel Cazenave il y a plus de 3 ans
- Tracker changé de Support à Development
- Projet changé de Docbow à Django Journal
- Assigné à mis à Emmanuel Cazenave
Mis à jour par Emmanuel Cazenave il y a plus de 3 ans
- Fichier 0001-admin-replace-unicode-by-force_text-46563.patch 0001-admin-replace-unicode-by-force_text-46563.patch ajouté
- Statut changé de Nouveau à Solution proposée
- Patch proposed changé de Non à Oui
Mis à jour par Christophe Siraut il y a plus de 3 ans
- Statut changé de Solution proposée à Solution validée
ok (mais je que ça ne résoud pas "Journal has no field named 'user'")
Mis à jour par Christophe Siraut il y a plus de 3 ans
j'ai testé sur la recette et le patch résout le problème.
Mis à jour par Emmanuel Cazenave il y a plus de 3 ans
- Statut changé de Solution validée à Résolu (à déployer)
commit cf5c11207451dcd4b807414b214ac5e51a00357e Author: Emmanuel Cazenave <ecazenave@entrouvert.com> Date: Fri Sep 11 10:22:55 2020 +0200 admin: replace unicode by force_text (#46563)
Mis à jour par Emmanuel Cazenave il y a plus de 3 ans
- Statut changé de Résolu (à déployer) à Solution déployée
admin: replace unicode by force_text (#46563)