From 792cea7c8851abe9a95a54f071ff78e2449fbfa0 Mon Sep 17 00:00:00 2001 From: ajnagashima Date: Tue, 29 Oct 2019 23:42:13 -0400 Subject: [PATCH 1/5] Strip leading\trailing whitespace on submission --- game_night/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/game_night/__init__.py b/game_night/__init__.py index c4b2445..c79622b 100644 --- a/game_night/__init__.py +++ b/game_night/__init__.py @@ -143,9 +143,11 @@ def submit(): return render_template( 'submit.html', error = next(iter(game.errors.values()))[0], form = game, - game_names = get_game_names(), **_get_template_variables() + game_names = get_game_names(), **() ) game = game.data + game = {k: v.strip() if type(v) == str else v for k,v in game.items()} + print(game.items()) _s3.upload_fileobj( game['image'], environ['S3_BUCKET'], game['name'] + '.jpg', ExtraArgs = { @@ -154,4 +156,4 @@ def submit(): ) insert_game(game, session['userinfo']['preferred_username']) flash('Game successfully submitted.') - return redirect('/') \ No newline at end of file + return redirect('/') From 25c9a420a680176d7e12b5433fd217d79f1e701f Mon Sep 17 00:00:00 2001 From: ajnagashima Date: Tue, 29 Oct 2019 23:46:36 -0400 Subject: [PATCH 2/5] Remove print statement used for testing --- game_night/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/game_night/__init__.py b/game_night/__init__.py index c79622b..8a51ed8 100644 --- a/game_night/__init__.py +++ b/game_night/__init__.py @@ -147,7 +147,6 @@ def submit(): ) game = game.data game = {k: v.strip() if type(v) == str else v for k,v in game.items()} - print(game.items()) _s3.upload_fileobj( game['image'], environ['S3_BUCKET'], game['name'] + '.jpg', ExtraArgs = { From 2ef766b56cc59bb70da5a13115468d0160a31991 Mon Sep 17 00:00:00 2001 From: ajnagashima Date: Tue, 29 Oct 2019 23:49:03 -0400 Subject: [PATCH 3/5] Half of statement was removed by accident Issue went unnoticed while testing Should've just been one commit :,( --- game_night/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game_night/__init__.py b/game_night/__init__.py index 8a51ed8..8673810 100644 --- a/game_night/__init__.py +++ b/game_night/__init__.py @@ -143,7 +143,7 @@ def submit(): return render_template( 'submit.html', error = next(iter(game.errors.values()))[0], form = game, - game_names = get_game_names(), **() + game_names = get_game_names(), **_get_template_variables() ) game = game.data game = {k: v.strip() if type(v) == str else v for k,v in game.items()} From a5074e92eec06f8ae8b17ae6ae67e4916e550233 Mon Sep 17 00:00:00 2001 From: ajnagashima Date: Wed, 30 Oct 2019 00:28:58 -0400 Subject: [PATCH 4/5] Add footer to bottom of page that links to github --- game_night/templates/base.html | 5 +++++ game_night/templates/include/footer.html | 6 ++++++ 2 files changed, 11 insertions(+) create mode 100644 game_night/templates/include/footer.html diff --git a/game_night/templates/base.html b/game_night/templates/base.html index 3f710bb..718584a 100644 --- a/game_night/templates/base.html +++ b/game_night/templates/base.html @@ -81,5 +81,10 @@ {% block content %} {% endblock %} + + {% block footer %} + {% include "include/footer.html" %} + {% endblock %} + diff --git a/game_night/templates/include/footer.html b/game_night/templates/include/footer.html new file mode 100644 index 0000000..41277b1 --- /dev/null +++ b/game_night/templates/include/footer.html @@ -0,0 +1,6 @@ + From f3a0f08d32a5b9536933da8d1dff8b23f7507835 Mon Sep 17 00:00:00 2001 From: ajnagashima Date: Wed, 30 Oct 2019 00:31:48 -0400 Subject: [PATCH 5/5] Revert "Add footer to bottom of page that links to github" Oops, made a push to the wrong branch --- game_night/templates/base.html | 5 ----- game_night/templates/include/footer.html | 6 ------ 2 files changed, 11 deletions(-) delete mode 100644 game_night/templates/include/footer.html diff --git a/game_night/templates/base.html b/game_night/templates/base.html index 718584a..3f710bb 100644 --- a/game_night/templates/base.html +++ b/game_night/templates/base.html @@ -81,10 +81,5 @@ {% block content %} {% endblock %} - - {% block footer %} - {% include "include/footer.html" %} - {% endblock %} - diff --git a/game_night/templates/include/footer.html b/game_night/templates/include/footer.html deleted file mode 100644 index 41277b1..0000000 --- a/game_night/templates/include/footer.html +++ /dev/null @@ -1,6 +0,0 @@ -