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

fixed user name issue in the audit log for leave bot api #1567

Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion kairon/shared/account/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,11 +598,12 @@ def remove_bot_access(bot: Text, **kwargs):
active_bot_access = BotAccess.objects(
**kwargs, bot=bot, status__ne=ACTIVITY_STATUS.DELETED.value
).get()
active_bot_access.update(set__status=ACTIVITY_STATUS.DELETED.value, user=kwargs.get('accessor_email'))
else:
active_bot_access = BotAccess.objects(
bot=bot, status__ne=ACTIVITY_STATUS.DELETED.value
)
active_bot_access.update(set__status=ACTIVITY_STATUS.DELETED.value)
active_bot_access.update(set__status=ACTIVITY_STATUS.DELETED.value)

@staticmethod
def remove_member(bot: Text, accessor_email: Text, current_user: Text):
Expand Down
2 changes: 1 addition & 1 deletion kairon/shared/data/audit/data_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,5 @@ def delete(self, signal_kwargs=None, event_url=None, user=None, **write_concern)

def update(self, event_url=None, **kwargs):
obj = super().update(**kwargs)
auditlog.send(self.__class__, document=self, action=AuditlogActions.UPDATE.value, event_url=event_url)
auditlog.send(self.__class__, document=self, action=AuditlogActions.UPDATE.value, event_url=event_url, user=kwargs.get('user'))
return obj
Loading