Skip to content

Commit

Permalink
prefer that course credits are not None
Browse files Browse the repository at this point in the history
  • Loading branch information
AaDalal committed Apr 11, 2024
1 parent 39c89c4 commit 1810373
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion backend/degree/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ def get_course(self, obj):
Course.with_reviews.filter(
full_code=obj.full_code, semester__lte=get_current_semester()
)
.order_by("-semester")
.order_by(
"credits", # prefer that credits are not None
"-semester"
)
.first()
)
if course is not None:
Expand Down

0 comments on commit 1810373

Please sign in to comment.