-
Notifications
You must be signed in to change notification settings - Fork 79
Open
Description
I have a model as following:
class UserMoodLog(TimeStampedModel, Activity):
user = models.ForeignKey('users.User', on_delete=models.CASCADE)
is_happy = models.BooleanField(_("is happy"), default=False)
I want to create activity associated to this model on it's creation only when is_happy=True
. I tried overriding create_activity()
and call super create_activity()
only when is_happy=True
but a activity must be returned from that, otherwise this line
stream-django/stream_django/managers.py
Line 64 in 9f5fcce
result = feed.add_activity(activity) |
None
(because when is_happy=False
I am not calling super create_activity()
and thus None
is returned by overridden create_activity()
)
Can someone please point me towards the right direction ?
Metadata
Metadata
Assignees
Labels
No labels