From 76bcd21e0a11bf55b75c594a8edd201208bfe9f5 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Tue, 3 Jul 2018 10:06:44 +0200 Subject: [PATCH] [Refactor] Make the app routes static methods MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit They don’t use self, so PyLint complains. --- calsocial/__init__.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/calsocial/__init__.py b/calsocial/__init__.py index b8db121..693a875 100644 --- a/calsocial/__init__.py +++ b/calsocial/__init__.py @@ -106,8 +106,9 @@ class CalendarSocialApp(Flask): self.route(*args, **kwargs)(attr) + @staticmethod @route('/') - def hello(self): + def hello(): """View for the main page This will display a welcome message for users not logged in; for others, their main @@ -128,8 +129,9 @@ class CalendarSocialApp(Flask): return render_template('index.html', calendar=calendar) + @staticmethod @route('/register', methods=['POST', 'GET']) - def register(self): + def register(): """View for user registration If the ``REGISTRATION_FAILED`` configuration value is set to ``True`` it displays the @@ -156,9 +158,10 @@ class CalendarSocialApp(Flask): return render_template('registration.html', form=form) + @staticmethod @route('/new-event', methods=['GET', 'POST']) @login_required - def new_event(self): + def new_event(): """View for creating a new event This presents a form to the user that allows entering event details.