mirror of
https://github.com/ansible/awx.git
synced 2024-11-02 09:51:09 +03:00
Initial backend implementation for AC-25, activity stream/audit love
This commit is contained in:
parent
3a02c17d2a
commit
2a16ab38a5
@ -333,3 +333,28 @@ class CommonTask(PrimordialModel):
|
|||||||
self.cancel_flag = True
|
self.cancel_flag = True
|
||||||
self.save(update_fields=['cancel_flag'])
|
self.save(update_fields=['cancel_flag'])
|
||||||
return self.cancel_flag
|
return self.cancel_flag
|
||||||
|
|
||||||
|
class ActivityStream(models.Model):
|
||||||
|
'''
|
||||||
|
Model used to describe activity stream (audit) events
|
||||||
|
'''
|
||||||
|
OPERATION_CHOICES = [
|
||||||
|
('create', _('Entity Created')),
|
||||||
|
('update', _("Entity Updated")),
|
||||||
|
('delete', _("Entity Deleted")),
|
||||||
|
('associate', _("Entity Associated with another Entity")),
|
||||||
|
('disaassociate', _("Entity was Disassociated with another Entity"))
|
||||||
|
]
|
||||||
|
|
||||||
|
user = models.ForeignKey('auth.User', null=True, on_delete=SET_NULL)
|
||||||
|
operation = models.CharField(max_length=9, choices=OPERATION_CHOICES)
|
||||||
|
timestamp = models.DateTimeField(auto_now_add=True)
|
||||||
|
changes = models.TextField(blank=True)
|
||||||
|
|
||||||
|
object1_id = models.PositiveIntegerField(db_index=True)
|
||||||
|
object1_type = models.TextField()
|
||||||
|
|
||||||
|
object2_id = models.PositiveIntegerField(db_index=True)
|
||||||
|
object2_type = models.TextField()
|
||||||
|
|
||||||
|
object_relationship_type = models.TextField()
|
||||||
|
Loading…
Reference in New Issue
Block a user