Skip to content

Commit

Permalink
move disabled_utc to be with the other fields
Browse files Browse the repository at this point in the history
fixes #116
  • Loading branch information
guruofgentoo committed Jan 28, 2021
1 parent 39c87c4 commit dd1bf5e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions keg_auth/model/__init__.py
Expand Up @@ -80,6 +80,10 @@ class UserMixin(object):
# when a user logs in.
last_login_utc = sa.Column(ArrowType, nullable=True, default=None, server_default=None)

# The datetime when a user will be disabled. User will be inactive if this is set
# to a datetime in the past.
disabled_utc = sa.Column(ArrowType, nullable=True, default=None, server_default=sa.null())

# is_active defines the complexities of how to determine what users are active. For instance,
# if email is in scope, we need to have an additional flag to verify users, and that would
# get included in is_active logic.
Expand All @@ -105,10 +109,6 @@ def is_disabled_by_date(cls):
)
return sa_sql.case([(is_disabled_expr, sa.true())], else_=sa.false())

# The datetime when a user will be disabled. User will be inactive if this is set
# to a datetime in the past.
disabled_utc = sa.Column(ArrowType, nullable=True, default=None, server_default=sa.null())

def get_id(self):
# Flask-Login requires that this return a string value for the session
return str(self.session_key)
Expand Down

0 comments on commit dd1bf5e

Please sign in to comment.