Skip to content

Commit

Permalink
Display marks correctly in the movie page
Browse files Browse the repository at this point in the history
The marks weren't displayed correctly when homework were completed : mark and
comment weren't displayed and the homework status was already displayed.

This commit closes #16.
  • Loading branch information
ptitoliv committed Jun 12, 2016
1 parent f263647 commit 075bfe6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cineapp/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,10 @@ def show_movie(movie_id):
marked_movie=Mark.query.get((cur_user.id,movie_id))

if marked_movie != None:
if marked_movie.homework_who != None:

# We are in homework mode if a user gave an homework AND the mark is still none
# If not we are in mark mode
if marked_movie.homework_who != None and marked_movie.mark == None:
mark_users.append({ "user": cur_user, "mark": "homework_in_progress", "comment": "N/A" })
else:
mark_users.append({ "user": cur_user, "mark": marked_movie.mark, "comment": marked_movie.comment })
Expand Down

0 comments on commit 075bfe6

Please sign in to comment.