mirror of
https://github.com/lemeow125/DRF_Template.git
synced 2025-08-03 01:33:15 +08:00
Overhauled entire project config, added notifications, email templates, optimized stripe subscriptions, redis caching, and webdriver utilities
This commit is contained in:
parent
7cbe8fd720
commit
99dfcef67b
84 changed files with 4300 additions and 867 deletions
13
backend/notifications/tasks.py
Normal file
13
backend/notifications/tasks.py
Normal file
|
@ -0,0 +1,13 @@
|
|||
from celery import shared_task
|
||||
from django.utils import timezone
|
||||
from notifications.models import Notification
|
||||
|
||||
|
||||
@shared_task
|
||||
def cleanup_notifications():
|
||||
# Calculate the date 3 days ago
|
||||
three_days_ago = timezone.now() - timezone.timedelta(days=3)
|
||||
|
||||
# Delete notifications that are older than 3 days and dismissed
|
||||
Notification.objects.filter(
|
||||
dismissed=True, timestamp__lte=three_days_ago).delete()
|
Loading…
Add table
Add a link
Reference in a new issue