Skip to content

Commit

Permalink
Merge pull request #84 from vikingco/CP-121/django1.9-upgrade-backwar…
Browse files Browse the repository at this point in the history
…dscompatible

CP-121: Django 1.9 Upgrade (backwards compatible changes)
  • Loading branch information
Johan Gabriels committed May 17, 2016
2 parents 4cf1662 + fc80687 commit 3e5d1da
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions django_states/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,15 @@ class _StateTransition(six.with_metaclass(_StateTransitionMeta, models.Model)):
from_state = models.CharField(max_length=100,
choices=get_state_choices())
to_state = models.CharField(max_length=100, choices=get_state_choices())
user = models.ForeignKey(getattr(settings, 'AUTH_USER_MODEL', 'auth.User'), blank=True, null=True)
user = models.ForeignKey(getattr(settings, 'AUTH_USER_MODEL', 'auth.User'), on_delete=models.CASCADE,
blank=True, null=True)
serialized_kwargs = models.TextField(blank=True)

start_time = models.DateTimeField(
auto_now_add=True, db_index=True,
verbose_name=_('transition started at')
)
on = models.ForeignKey(state_model, related_name=('%s_history' % field_name))
on = models.ForeignKey(state_model, on_delete=models.CASCADE, related_name=('%s_history' % field_name))

class Meta:
"""Non-field Options"""
Expand Down

0 comments on commit 3e5d1da

Please sign in to comment.