Skip to content

Commit c25a584

Browse files
committed
updated cronjobs
1 parent 863ad17 commit c25a584

File tree

8 files changed

+15
-7
lines changed

8 files changed

+15
-7
lines changed
-41 Bytes
Binary file not shown.
-8 Bytes
Binary file not shown.

backend/settings.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,6 @@
252252
CRONJOBS = [
253253
# Run every hour
254254
('0 * * * *', 'core.tasks.update_movie_popularity_scores'),
255-
('* * * * *', 'core.tasks.test_hello_every_minute'),
256-
257255
# Or run daily at midnight
258256
('0 2 * * *', 'core.tasks.update_search_vectors'),
259257
]
693 Bytes
Binary file not shown.
62 Bytes
Binary file not shown.

core/admin.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,24 @@
11
from django.contrib import admin
22
from unfold.admin import ModelAdmin
33
from .models import (
4-
Profile, Movie, Favorite, Rating, Comment, WatchList, Logs, MovieInteraction
4+
Profile, Movie, Favorite, Rating, Comment, WatchList, Logs, MovieInteraction, UserPreference, MovieTaste
55
)
66

77

8+
@admin.register(UserPreference)
9+
class UserPreferenceAdmin(ModelAdmin):
10+
list_display = ('user', 'age', 'gender', 'watch_frequency', 'created_at')
11+
search_fields = ('user__email', 'gender', 'watch_frequency')
12+
list_filter = ('gender', 'watch_frequency', 'created_at')
13+
readonly_fields = ('created_at', 'updated_at')
14+
15+
@admin.register(MovieTaste)
16+
class MovieTasteAdmin(ModelAdmin):
17+
list_display = ('user', 'movie', 'taste', 'created_at')
18+
search_fields = ('user__email', 'movie__title', 'taste')
19+
list_filter = ('taste', 'created_at')
20+
readonly_fields = ('created_at', 'updated_at')
21+
822
@admin.register(MovieInteraction)
923
class MovieInteractionAdmin(ModelAdmin):
1024
list_display = ('movie', 'interaction_type', 'user', 'timestamp')
-74 Bytes
Binary file not shown.

core/tasks.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ def update_movie_popularity_scores():
1616
logger.error(f"Error updating movie popularity scores: {str(e)}")
1717

1818

19-
def test_hello_every_minute():
20-
"""Test cron job"""
21-
logger.log('INFO', 'Hello, every minute!', 'test_hello_every_minute')
22-
2319

2420
def update_search_vectors():
2521
"""Update search vectors for all movies"""

0 commit comments

Comments
 (0)