Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed message format of deleted objects. #9

Merged
merged 1 commit into from
Jan 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion src/auditlog/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,25 @@ def msg_short(self, obj):
if obj.action == 3 or obj.action == 4 or obj.action == 0 and obj.content_type_id == 108 and obj.additional_data == "Client_name" or obj.action == 2 and obj.additional_data == "Client_name": #to display changes for actions of download-3,KLC-4
return obj.changes #and also when create action-0 is done for client name in Client Group
if obj.action == 2:
return 'Deleted object' # delete
if obj.content_type_id == 4:
deleted_obj = "User"
elif obj.content_type_id == 7:
deleted_obj = "Partner"
elif obj.content_type_id == 8:
deleted_obj = "Client API"
elif obj.content_type_id == 9:
deleted_obj = "Client"
elif obj.content_type_id == 10:
deleted_obj = "User partner info"
elif obj.content_type_id == 46:
deleted_obj = "Alerts"
elif obj.content_type_id == 90:
deleted_obj = "User contact info"
elif obj.content_type_id == 108:
deleted_obj = "Client group"
else:
deleted_obj = "Object"
return '%s' %deleted_obj + ' is deleted.' # delete
changes = json.loads(obj.changes)
s = '' if len(changes) == 1 else 's'
fields = ', '.join(changes.keys())
Expand Down