From a9d768cee6988214fe3b4c38bfe1a1fd8636189c Mon Sep 17 00:00:00 2001 From: RyanBeatty Date: Wed, 13 Jan 2016 22:47:48 -0500 Subject: [PATCH] changed driver_portal redirect to just be a 403 --- steerclear/driver_portal/views.py | 3 +-- tests/driver_portal_tests/views_tests.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/steerclear/driver_portal/views.py b/steerclear/driver_portal/views.py index 6342c10..a514ec2 100644 --- a/steerclear/driver_portal/views.py +++ b/steerclear/driver_portal/views.py @@ -16,9 +16,8 @@ def heartbeat(): @driver_portal_bp.route('/index') @login_required +@admin_permission.require(http_exception=403) def index(): - if not admin_permission.can(): - return redirect(url_for('.heartbeat')) return render_template('index.html') @driver_portal_bp.route('/privacy-policy', defaults={'path': 'index.html'}) diff --git a/tests/driver_portal_tests/views_tests.py b/tests/driver_portal_tests/views_tests.py index 38d7d3b..808ac32 100644 --- a/tests/driver_portal_tests/views_tests.py +++ b/tests/driver_portal_tests/views_tests.py @@ -47,5 +47,5 @@ def test_get_index_admin_user(self): def test_get_index_student_user(self): self._login(self.student_user) response = self.client.get(url_for('driver_portal.index')) - self.assertRedirects(response, url_for('driver_portal.heartbeat')) + self.assertEquals(response.status_code, 403)