Certain information is being logged and stored in the database for future reference, resolving conflicts in case of hacks and for maintaining an overview of the system. These are -
- Create/Update/Delete Event
- Create/Update User
- Update user email
- Assign/Edit/Remove an event-level role
- Create/Update/Delete Track
- Send Invite for Event
- Assign/Remove a system level role
- Publish/Unpublish event
- Import/Export Event
- Add Speaker to Session
- Create/Update/Delete Speaker
- Create/Update/Delete Session
- Login/Logout from user (tracking IP, browser, platform)
From the app.helpers.data
module, import record_activity
.
Then call it using the identifier of the activity-type and the parameters.
The list of identifiers is located in app.models.activity
. At the time of writing, it looks like -
ACTIVITIES = {
'create_user': 'User {user} created',
'update_user': 'Profile of user {user} updated',
'update_event': 'Event {event_id} updated',
'create_event': 'Event {event_id} created',
'delete_event': 'Event {event_id} deleted',
'create_role': 'Role {role} created for user {user} in event {event_id}',
'update_role': 'Role updated to {role} for user {user} in event {event_id}',
'delete_role': 'User {user} removed from role {role} in event {event_id}',
'create_session': 'Session {session} was created in event {event_id}'
}
Now, if for example you want to record a delete event activity, you call
record_activity('delete_event', event_id=event_id)