Internal
Public Access
Fix Critical Security Issue: Replace print() with proper logging
Replaced all debug print() statements with proper logging framework: - tasks/views.py: 5 print statements → logger.debug() - sync/views.py: 15 print statements → logger.debug() - config/celery.py: 1 print statement → logger.debug() - notifications/tasks.py: 2 print statements → logger.error() Retained print() in settings files (development.py, selfhosted.py) as they are appropriate warnings to stderr for configuration issues. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.5
parent
a22c3eed50
commit
b57321e1e4
@@ -2,10 +2,13 @@
|
||||
Celery tasks for notifications.
|
||||
"""
|
||||
|
||||
import logging
|
||||
from celery import shared_task
|
||||
from django.utils import timezone
|
||||
from datetime import timedelta
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@shared_task
|
||||
def send_due_reminders():
|
||||
@@ -157,7 +160,7 @@ def send_fcm_notification(token, title, body, data=None):
|
||||
|
||||
except Exception as e:
|
||||
# Log error but don't fail
|
||||
print(f"FCM notification failed: {e}")
|
||||
logger.error(f"FCM notification failed: {e}")
|
||||
|
||||
|
||||
@shared_task
|
||||
@@ -187,7 +190,7 @@ def send_web_push_notification(subscription_info, title, body, data=None):
|
||||
)
|
||||
|
||||
except Exception as e:
|
||||
print(f"Web push notification failed: {e}")
|
||||
logger.error(f"Web push notification failed: {e}")
|
||||
|
||||
|
||||
@shared_task
|
||||
|
||||
Reference in New Issue
Block a user