Skip to content

Commit

Permalink
fixed some quick things
Browse files Browse the repository at this point in the history
  • Loading branch information
nruia-penn committed Oct 20, 2024
1 parent bf06256 commit 6a071c3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
24 changes: 12 additions & 12 deletions backend/alert/management/commands/alertstats.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@ def update_hot_courses(self, qs):
Course.objects.update(is_hot_course = False)
max_hot_courses = 2

course_registration_counts = (
qs
.values('section__course')
.annotate(num_registrations=Count('id'))
.order_by('-num_registrations')
)

top_alert_courses = [
item['section__course'] for item in course_registration_counts[:max_hot_courses]
]

top_alert_courses_set = set(top_alert_courses)
# course_registration_counts = (
# qs
# .values('section__course')
# .annotate(num_registrations=Count('id'))
# .order_by('-num_registrations')
# )

# top_alert_courses = [
# item['section__course'] for item in course_registration_counts[:max_hot_courses]
# ]

# top_alert_courses_set = set(top_alert_courses)

courses = Course.objects.filter(semester=get_current_semester()).prefetch_related('sections')

Expand Down
2 changes: 1 addition & 1 deletion backend/review/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def course_is_hot(courseName, registrationMetrics):
}
for course in hot_courses
]
return(courses_data)
return(True)



Expand Down

0 comments on commit 6a071c3

Please sign in to comment.