Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ tags
.env

db.sqlite3

media/
1 change: 0 additions & 1 deletion Procfile

This file was deleted.

1 change: 0 additions & 1 deletion Procfile.windows

This file was deleted.

Binary file added film_management/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file added film_management/__pycache__/admin.cpython-38.pyc
Binary file not shown.
Binary file added film_management/__pycache__/apps.cpython-38.pyc
Binary file not shown.
Binary file added film_management/__pycache__/models.cpython-38.pyc
Binary file not shown.
Binary file added film_management/__pycache__/urls.cpython-38.pyc
Binary file not shown.
Binary file added film_management/__pycache__/views.cpython-38.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
7 changes: 6 additions & 1 deletion 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 All @@ -9,7 +14,7 @@ tr {
height: 50px;
}

tr:hover {
tr:hover:not(:first-child) {
background-color: var(--selected-bg-color);
}

Expand Down
Binary file not shown.
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
Binary file modified media/logo/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified philmnight/__pycache__/settings.cpython-38.pyc
Binary file not shown.
Binary file added philmnight/__pycache__/urls.cpython-38.pyc
Binary file not shown.
Binary file added philmnight/__pycache__/views.cpython-38.pyc
Binary file not shown.
Binary file added philmnight/__pycache__/wsgi.cpython-38.pyc
Binary file not shown.
5 changes: 3 additions & 2 deletions philmnight/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

# SECURITY WARNING: keep the secret key used in production secret!

# Detect heroku
if 'DYNO' not in os.environ:
from dotenv import load_dotenv
load_dotenv()
Expand All @@ -34,11 +35,11 @@
TMDB_ENDPOINT = os.environ['TMDB_ENDPOINT']
TMDB_KEY = os.environ['TMDB_KEY']

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = os.environ['DEBUG']
except KeyError:
raise KeyError('Not all required environment variables present')

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = ['*']

Expand Down
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
django_heroku==0.3.1
requests==2.22.0
Django==2.2.2
python-dotenv==0.12.0
django_heroku
requests
Django
python-dotenv
gunicorn
requests_oauthlib
social-auth-app-django
Expand Down
1 change: 0 additions & 1 deletion run.bat

This file was deleted.

1 change: 0 additions & 1 deletion run.sh

This file was deleted.

Binary file removed static/hacksoc.png
Binary file not shown.