From 41f6c88df19f192ed8698fa81a3d483399de22b5 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Tue, 10 Jul 2018 16:39:16 +0200 Subject: [PATCH] Make PyLint happy again --- calsocial/__init__.py | 2 -- calsocial/models.py | 8 +++++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/calsocial/__init__.py b/calsocial/__init__.py index 189e436..d449faa 100644 --- a/calsocial/__init__.py +++ b/calsocial/__init__.py @@ -334,8 +334,6 @@ class CalendarSocialApp(Flask): """View to accept an invitation """ - from flask import redirect, url_for - from .models import db, Invitation, Response, ResponseType invitation = Invitation.query.get_or_404(invite_id) diff --git a/calsocial/models.py b/calsocial/models.py index b7e1ebb..1598a54 100644 --- a/calsocial/models.py +++ b/calsocial/models.py @@ -307,6 +307,9 @@ class Profile(db.Model): # pylint: disable=too-few-public-methods @property def url(self): + """Get the URL for this profile + """ + from flask import url_for if self.user: @@ -390,6 +393,9 @@ class Event(db.Model): @property def url(self): + """The URL of the event + """ + from flask import url_for return url_for('event_details', event_uuid=self.event_uuid) @@ -609,7 +615,7 @@ class Notification(db.Model): """Get the translated message for ``key`` in HTML format """ - from flask import url_for, Markup + from flask import Markup from flask_security import current_user messages = NOTIFICATION_ACTION_MESSAGES.get(self.action)