Bug #4532

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

Added by Jérôme Schneider about 10 years ago. Updated about 10 years ago.

Target version:
Start date:
20 March 2014
Due date:
% Done:


Estimated time:
Patch proposed:


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

  File "django/core/handlers/", line 115, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "django/contrib/auth/", line 25, in _wrapped_view
    return view_func(request, *args, **kwargs)
  File "django/views/generic/", line 68, in view
    return self.dispatch(request, *args, **kwargs)
  File "calebasse/", line 57, in dispatch
    result = super(ServiceViewMixin, self).dispatch(request, **kwargs)
  File "django/views/generic/", line 86, in dispatch
    return handler(request, *args, **kwargs)
  File "calebasse/", line 367, in get
    return super(BaseMultiUpdateView, self).get(request, *args, **kwargs)
  File "calebasse/", line 327, in get
    return self.render_to_response(self.get_context_data(forms=forms))
  File "calebasse/dossiers/", 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 about 10 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.



Updated by Jérôme Schneider about 10 years ago

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


Updated by Mikaël Ates about 10 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.


Updated by Mikaël Ates about 10 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.


Updated by Mikaël Ates about 10 years ago

Appliqué par commit calebasse|commit:584b363f00127b608af152d9114ceca1e268a1e0.


Updated by Mikaël Ates about 10 years ago

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

Also available in: Atom PDF