Project

General

Profile

Bug #30459

trace sur appel à api-event-status avec un event_pk qui n'est pas un entier

Added by Frédéric Péters 2 months ago. Updated about 2 months ago.

Status:
Solution déployée
Priority:
Normal
Category:
-
Start date:
07 Feb 2019
Due date:
% Done:

0%

Patch proposed:
Yes
Planning:
No

Description

Il y a dans l'appel quelque chose de mauvais mais chrono ne devrait pas planter pour autant.

File "/usr/lib/python2.7/dist-packages/chrono/api/views.py" in get
  559.         event = get_object_or_404(Event, id=event_pk)

File "/usr/lib/python2.7/dist-packages/django/shortcuts.py" in get_object_or_404
  85.         return queryset.get(*args, **kwargs)

File "/usr/lib/python2.7/dist-packages/django/db/models/query.py" in get
  371.         clone = self.filter(*args, **kwargs)

File "/usr/lib/python2.7/dist-packages/django/db/models/query.py" in filter
  787.         return self._filter_or_exclude(False, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/django/db/models/query.py" in _filter_or_exclude
  805.             clone.query.add_q(Q(*args, **kwargs))

File "/usr/lib/python2.7/dist-packages/django/db/models/sql/query.py" in add_q
  1250.         clause, _ = self._add_q(q_object, self.used_aliases)

File "/usr/lib/python2.7/dist-packages/django/db/models/sql/query.py" in _add_q
  1276.                     allow_joins=allow_joins, split_subq=split_subq,

File "/usr/lib/python2.7/dist-packages/django/db/models/sql/query.py" in build_filter
  1210.             condition = self.build_lookup(lookups, col, value)

File "/usr/lib/python2.7/dist-packages/django/db/models/sql/query.py" in build_lookup
  1104.                 return final_lookup(lhs, rhs)

File "/usr/lib/python2.7/dist-packages/django/db/models/lookups.py" in __init__
  24.         self.rhs = self.get_prep_lookup()

File "/usr/lib/python2.7/dist-packages/django/db/models/lookups.py" in get_prep_lookup
  74.             return self.lhs.output_field.get_prep_value(self.rhs)

File "/usr/lib/python2.7/dist-packages/django/db/models/fields/__init__.py" in get_prep_value
  966.         return int(value)

Exception Type: ValueError at /api/agenda/event-culture/status/None/
Exception Value: invalid literal for int() with base 10: 'None'

0001-api-make-sure-event-status-API-only-accepts-numbers-.patch View (1.5 KB) Frédéric Péters, 07 Feb 2019 01:36 PM

Associated revisions

Revision b9a2848a (diff)
Added by Frédéric Péters about 2 months ago

api: make sure event status API only accepts numbers (#30459)

History

#1 Updated by Frédéric Péters 2 months ago

#2 Updated by Benjamin Dauvergne 2 months ago

Ack.

#3 Updated by Frédéric Péters 2 months ago

  • Status changed from Solution proposée to Solution validée

#4 Updated by Frédéric Péters about 2 months ago

  • Status changed from Solution validée to Résolu (à déployer)
commit b9a2848a2699f06c3b1db0bf8c45111f3f93dd60
Author: Frédéric Péters <fpeters@entrouvert.com>
Date:   Thu Feb 7 13:35:52 2019 +0100

    api: make sure event status API only accepts numbers (#30459)

#5 Updated by Frédéric Péters about 2 months ago

  • Status changed from Résolu (à déployer) to Solution déployée

Also available in: Atom PDF