Update activity logs service to use the manager approach
@@ -7,12 +7,12 @@ class ActivityLogService(EventService):
event_manager = default_manager
def __init__(self):
- self.activity_log = None
+ self.activity_log_manager = None
def record_event(self, event):
assert event.actor_id is not None
actor_id = event.data[event.actor_id]
- return self.activity_log.objects.create(
+ return self.activity_log_manager.create(
event_type=event.event_type,
actor_id=actor_id if actor_id != user_system.USER_SYSTEM_ID else None,
context=event.data,
@@ -28,4 +28,4 @@ class ActivityLogService(EventService):
from db.models.activitylogs import ActivityLog
- self.activity_log = ActivityLog
+ self.activity_log_manager = ActivityLog.objects
