Skip to content

Commit 068043c

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent e44290a commit 068043c

File tree

2 files changed

+12
-15
lines changed

2 files changed

+12
-15
lines changed

flask_lastuser/__init__.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -486,8 +486,7 @@ def permissions(self):
486486
return (
487487
current_auth.lastuserinfo is not None
488488
and current_auth.lastuserinfo.permissions
489-
or []
490-
)
489+
) or []
491490

492491
def has_permission(self, permission):
493492
"""Returns True if the current user has the specified permission.

flask_lastuser/sqlalchemy.py

+11-13
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,17 @@
3434
from . import UserInfo, UserManagerBase, __, signal_user_looked_up
3535

3636
__all__ = [
37-
'UserBase',
38-
'UserBase2',
39-
'TeamMixin',
40-
'TeamMembersMixin',
41-
'TeamBase',
42-
'TeamBase2',
37+
'IncompleteUserMigrationError',
38+
'ProfileBase',
4339
'ProfileMixin',
4440
'ProfileMixin2',
45-
'ProfileBase',
41+
'TeamBase',
42+
'TeamBase2',
43+
'TeamMembersMixin',
44+
'TeamMixin',
45+
'UserBase',
46+
'UserBase2',
4647
'UserManager',
47-
'IncompleteUserMigrationError',
4848
]
4949

5050

@@ -140,10 +140,8 @@ def timezone(self):
140140
# Stored in userinfo since it was introduced later and a new column
141141
# will require migrations in downstream apps.
142142
return (
143-
self.userinfo
144-
and self.userinfo.get('timezone')
145-
or current_app.config.get('TIMEZONE')
146-
)
143+
self.userinfo and self.userinfo.get('timezone')
144+
) or current_app.config.get('TIMEZONE')
147145

148146
@property
149147
def oldids(self):
@@ -152,7 +150,7 @@ def oldids(self):
152150
# will require migrations in downstream apps. Also, this is an array
153151
# and will require (a) a joined table, (b) Postgres-specific arrays, or (c) data massaging
154152
# by joining with spaces, like "access_scope" above.
155-
return self.userinfo and self.userinfo.get('oldids') or []
153+
return (self.userinfo and self.userinfo.get('oldids')) or []
156154

157155
# Use cached_property here because pytz.timezone is relatively slow:
158156
#

0 commit comments

Comments
 (0)