Skip to content

Commit

Permalink
Defer loading of DEPRECATED users columns
Browse files Browse the repository at this point in the history
  • Loading branch information
ikus060 committed Sep 14, 2022
1 parent 3e7911a commit a04b95b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions rdiffweb/core/model/_user.py
Expand Up @@ -21,7 +21,7 @@
from sqlalchemy import Column, Integer, SmallInteger, String, and_, event, inspect, or_
from sqlalchemy.exc import IntegrityError
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy.orm import relationship
from sqlalchemy.orm import deferred, relationship

import rdiffweb.tools.db # noqa
from rdiffweb.core import authorizedkeys
Expand Down Expand Up @@ -63,21 +63,21 @@ class UserObject(Base):
_username = Column('Username', String, nullable=False, unique=True)
hash_password = Column('Password', String, nullable=False, default="")
_user_root = Column('UserRoot', String, nullable=False, default="")
_is_admin = Column(
_is_admin = deferred(Column(
'IsAdmin',
SmallInteger,
nullable=False,
server_default="0",
doc="DEPRECATED This column is replaced by 'role'",
)
))
_email = Column('UserEmail', String, nullable=False, default="")
restore_format = Column(
restore_format = deferred(Column(
'RestoreFormat',
SmallInteger,
nullable=False,
server_default="1",
doc="DEPRECATED This column is not used anymore",
)
))
_role = Column('role', SmallInteger, nullable=False, server_default=str(USER_ROLE))
fullname = Column('fullname', String, nullable=False, default="")
repo_objs = relationship(
Expand Down

0 comments on commit a04b95b

Please sign in to comment.