diff --git a/apps/accounts/tasks/verify_account.py b/apps/accounts/tasks/verify_account.py index efc6bb09d..5f221fcd6 100644 --- a/apps/accounts/tasks/verify_account.py +++ b/apps/accounts/tasks/verify_account.py @@ -47,7 +47,7 @@ def verify_accounts_connectivity_util(accounts, task_name): @shared_task( queue="ansible", verbose_name=_('Verify asset account availability'), - activity_callback=lambda self, account_ids, asset_ids: (account_ids, None) + activity_callback=lambda self, account_ids, *args, **kwargs: (account_ids, None) ) def verify_accounts_connectivity_task(account_ids): from accounts.models import Account, VerifyAccountAutomation diff --git a/apps/audits/signal_handlers/activity_log.py b/apps/audits/signal_handlers/activity_log.py index 430b25002..4b41d2d1d 100644 --- a/apps/audits/signal_handlers/activity_log.py +++ b/apps/audits/signal_handlers/activity_log.py @@ -57,8 +57,8 @@ class ActivityLogHandler: resource_ids, org_id, user = data + ('',) * (3 - len(data)) if not user: user = str(current_request.user) if current_request else 'System' - if org_id is None: - org_id = current_org.org_id + if not org_id: + org_id = current_org.id task_display = getattr(task, 'verbose_name', _('Unknown')) detail = i18n_fmt( gettext_noop('User %s perform a task for this resource: %s'), diff --git a/apps/common/tasks.py b/apps/common/tasks.py index 76616803a..b4c3d3488 100644 --- a/apps/common/tasks.py +++ b/apps/common/tasks.py @@ -10,11 +10,11 @@ from .utils import get_logger logger = get_logger(__file__) -def task_activity_callback(self, subject, message, from_email, recipient_list, **kwargs): +def task_activity_callback(self, subject, message, recipient_list, **kwargs): from users.models import User email_list = recipient_list resource_ids = list(User.objects.filter(email__in=email_list).values_list('id', flat=True)) - return resource_ids + return resource_ids, @shared_task(verbose_name=_("Send email"), activity_callback=task_activity_callback)