[Refactor] Make the app routes static methods

They don’t use self, so PyLint complains.
This commit is contained in:
Gergely Polonkai 2018-07-03 10:06:44 +02:00
parent 2f66fdb83e
commit 76bcd21e0a

View File

@ -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.