Skip to content

Commit

Permalink
small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelVch98 committed Oct 15, 2024
1 parent 3625f2e commit 03cb096
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions course_preference.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ def save_preference():

preferences = data['preferences']
if preferences is None:
return make_response("No preferences received", 500)
flash("No preferences received", "error")

user_id = session["user_id"]
researcher = Researcher.query.filter(Researcher.user_id == user_id).first()
if researcher is None:
return make_response("User is not a researcher", 500)
flash("Researcher not found", "error")

new_course_ids = {preference['course_id'] for preference in preferences}
delete_old_preferences(researcher.id, new_course_ids, current_year)
Expand Down
1 change: 1 addition & 0 deletions templates/preferences.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
{% endblock %}

{% block pagecontent %}
{% include "toast.html" %}
<div class="container-fluid">
<form id="preferencesForm" method="post">
<br>
Expand Down

0 comments on commit 03cb096

Please sign in to comment.