Project

General

Profile

Bug #4532

AttributeError: 'NoneType' object has no attribute 'status'

Added by Jérôme Schneider almost 11 years ago. Updated almost 11 years ago.

Status:
Fermé
Priority:
Haut
Assignee:
Target version:
-
Start date:
20 March 2014
Due date:
% Done:

100%

Estimated time:
Patch proposed:
Planning:

Description

https://sentry.entrouvert.org/calebasse/calebasse-prod/group/247/

Stacktrace (appel le plus récent en dernier) : 

  File "django/core/handlers/base.py", line 115, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "django/contrib/auth/decorators.py", line 25, in _wrapped_view
    return view_func(request, *args, **kwargs)
  File "django/views/generic/base.py", line 68, in view
    return self.dispatch(request, *args, **kwargs)
  File "calebasse/cbv.py", line 57, in dispatch
    result = super(ServiceViewMixin, self).dispatch(request, **kwargs)
  File "django/views/generic/base.py", line 86, in dispatch
    return handler(request, *args, **kwargs)
  File "calebasse/cbv.py", line 367, in get
    return super(BaseMultiUpdateView, self).get(request, *args, **kwargs)
  File "calebasse/cbv.py", line 327, in get
    return self.render_to_response(self.get_context_data(forms=forms))
  File "calebasse/dossiers/views.py", line 275, in get_context_data
    if STATES_MAPPING.has_key(current_state.status.type):

Associated revisions

Revision 584b363f (diff)
Added by Mikaël Ates almost 11 years ago

There may be no current state, we have to handle it (fixes #4532).

Commit 09970a47d3528562940bb42ae7ce9b7904c44c62 introduced a more accurate
way to get a Patient record status at a given date returning None if there is
no state rather returning the last state not applying to the date given.
Then a current state may be None if the states are only applying in the future.
So we have to handle that case.

History

#1

Updated by Jérôme Schneider almost 11 years ago

C'est lié au commit 09970a47d3528562940bb42ae7ce9b7904c44c62 qui permet d'avoir un current state à None. Mike tu penses que je peux le revert ?

#2

Updated by Mikaël Ates almost 11 years ago

  • Assignee changed from Jérôme Schneider to Mikaël Ates

Non, il nous faut traiter le cas où le dossier n'a pas d'état courant car les états s'appliquent dans le future, ex: je crée un dossier avec une date de contact future.

#3

Updated by Mikaël Ates almost 11 years ago

  • Status changed from En cours to Résolu (à déployer)
  • % Done changed from 0 to 100

Appliqué par commit aps42:calebasse|commit:584b363f00127b608af152d9114ceca1e268a1e0.

#4

Updated by Mikaël Ates almost 11 years ago

Appliqué par commit calebasse|commit:584b363f00127b608af152d9114ceca1e268a1e0.

#5

Updated by Mikaël Ates almost 11 years ago

  • Status changed from Résolu (à déployer) to Fermé

Also available in: Atom PDF