Skip to content

Commit

Permalink
Film list title reformatted to match format of rest of site
Browse files Browse the repository at this point in the history
  • Loading branch information
dob9601 committed Jun 12, 2020
1 parent db7f55f commit c5f5910
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
Binary file modified film_management/__pycache__/views.cpython-38.pyc
Binary file not shown.
5 changes: 5 additions & 0 deletions film_management/static/films/css/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
h1 {
margin: 20px;
text-align: center;
}

table {
width: 100%;
text-align: left;
Expand Down
6 changes: 5 additions & 1 deletion film_management/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ def dashboard(request):


@login_required
def submit_film(request, tmdb_id):
def submit_film(request, tmdb_id): # TODO: Change to use POST instead of GET
"""Submit the provided film ID to the filmnight database."""
try:
last_user_film = Film.objects.filter(submitting_user=request.user).order_by('-date_submitted')[0]
last_submit_delta = (datetime.datetime.now()-last_user_film.date_submitted).seconds
Expand All @@ -116,17 +117,20 @@ def submit_film(request, tmdb_id):

return HttpResponseRedirect('/dashboard/')


@login_required
def film(request, tmdb_id):
film = Film.objects.get(tmdb_id=tmdb_id)
return render(request, 'film_management/film.html', {'film': film})


@user_passes_test(lambda u: u.is_superuser)
def delete_film(request, tmdb_id):
film = Film.objects.get(tmdb_id=tmdb_id)
film.delete()
return HttpResponseRedirect('/films/')


@login_required
def submit_votes(request):
if get_phase() == 'voting':
Expand Down

0 comments on commit c5f5910

Please sign in to comment.