notifciations issues fixed final
This commit is contained in:
@@ -426,6 +426,21 @@ class KeywordViewSet(SiteSectorModelViewSet):
|
||||
errors.append(f"Error adding '{seed_keyword.keyword}': {str(e)}")
|
||||
skipped_count += 1
|
||||
|
||||
# Create notification if keywords were added
|
||||
if created_count > 0:
|
||||
try:
|
||||
from igny8_core.business.notifications.services import NotificationService
|
||||
NotificationService.notify_keywords_imported(
|
||||
account=account,
|
||||
site=site,
|
||||
count=created_count
|
||||
)
|
||||
except Exception as e:
|
||||
# Don't fail the request if notification fails
|
||||
import logging
|
||||
logger = logging.getLogger(__name__)
|
||||
logger.warning(f"Failed to create notification for keywords import: {e}")
|
||||
|
||||
return success_response(
|
||||
data={
|
||||
'created': created_count,
|
||||
|
||||
Reference in New Issue
Block a user