"""User models."""
import datetime as dt

from flask_login import UserMixin

from registry.extensions import bcrypt, db


class User(UserMixin, db.Model):
    """A user of the app."""

    __tablename__ = "users"
    id = db.Column(db.Integer, primary_key=True)
    email = db.Column(
        db.String(80),
        unique=True,
        nullable=False,
    )
    password = db.Column(db.LargeBinary(128), nullable=False)
    created_at = db.Column(db.DateTime, nullable=False, default=dt.datetime.utcnow)
    active = db.Column(db.Boolean(), default=False)

    def __init__(self, email, password=None, **kwargs):
        """Create instance."""
        self.email = email
        self.set_password(password)

    def set_password(self, password):
        """Set password."""
        self.password = bcrypt.generate_password_hash(password)

    def check_password(self, value):
        """Check password."""
        return bcrypt.check_password_hash(self.password, value)

    def __repr__(self):
        """Represent instance as a unique string."""
        return f"<User({self.email!r})>"

3c59f80c5a6349aaf0c89089824d0b680bf95daa
<mask token>


class User(UserMixin, db.Model):
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>

    def __init__(self, email, password=None, **kwargs):
        """Create instance."""
        self.email = email
        self.set_password(password)

    def set_password(self, password):
        """Set password."""
        self.password = bcrypt.generate_password_hash(password)

    def check_password(self, value):
        """Check password."""
        return bcrypt.check_password_hash(self.password, value)

    def __repr__(self):
        """Represent instance as a unique string."""
        return f'<User({self.email!r})>'

<mask token>


class User(UserMixin, db.Model):
    <mask token>
    __tablename__ = 'users'
    id = db.Column(db.Integer, primary_key=True)
    email = db.Column(db.String(80), unique=True, nullable=False)
    password = db.Column(db.LargeBinary(128), nullable=False)
    created_at = db.Column(db.DateTime, nullable=False, default=dt.datetime
        .utcnow)
    active = db.Column(db.Boolean(), default=False)

    def __init__(self, email, password=None, **kwargs):
        """Create instance."""
        self.email = email
        self.set_password(password)

    def set_password(self, password):
        """Set password."""
        self.password = bcrypt.generate_password_hash(password)

    def check_password(self, value):
        """Check password."""
        return bcrypt.check_password_hash(self.password, value)

    def __repr__(self):
        """Represent instance as a unique string."""
        return f'<User({self.email!r})>'

<mask token>


class User(UserMixin, db.Model):
    """A user of the app."""
    __tablename__ = 'users'
    id = db.Column(db.Integer, primary_key=True)
    email = db.Column(db.String(80), unique=True, nullable=False)
    password = db.Column(db.LargeBinary(128), nullable=False)
    created_at = db.Column(db.DateTime, nullable=False, default=dt.datetime
        .utcnow)
    active = db.Column(db.Boolean(), default=False)

    def __init__(self, email, password=None, **kwargs):
        """Create instance."""
        self.email = email
        self.set_password(password)

    def set_password(self, password):
        """Set password."""
        self.password = bcrypt.generate_password_hash(password)

    def check_password(self, value):
        """Check password."""
        return bcrypt.check_password_hash(self.password, value)

    def __repr__(self):
        """Represent instance as a unique string."""
        return f'<User({self.email!r})>'

<mask token>
import datetime as dt
from flask_login import UserMixin
from registry.extensions import bcrypt, db


class User(UserMixin, db.Model):
    """A user of the app."""
    __tablename__ = 'users'
    id = db.Column(db.Integer, primary_key=True)
    email = db.Column(db.String(80), unique=True, nullable=False)
    password = db.Column(db.LargeBinary(128), nullable=False)
    created_at = db.Column(db.DateTime, nullable=False, default=dt.datetime
        .utcnow)
    active = db.Column(db.Boolean(), default=False)

    def __init__(self, email, password=None, **kwargs):
        """Create instance."""
        self.email = email
        self.set_password(password)

    def set_password(self, password):
        """Set password."""
        self.password = bcrypt.generate_password_hash(password)

    def check_password(self, value):
        """Check password."""
        return bcrypt.check_password_hash(self.password, value)

    def __repr__(self):
        """Represent instance as a unique string."""
        return f'<User({self.email!r})>'

"""User models."""
import datetime as dt

from flask_login import UserMixin

from registry.extensions import bcrypt, db


class User(UserMixin, db.Model):
    """A user of the app."""

    __tablename__ = "users"
    id = db.Column(db.Integer, primary_key=True)
    email = db.Column(
        db.String(80),
        unique=True,
        nullable=False,
    )
    password = db.Column(db.LargeBinary(128), nullable=False)
    created_at = db.Column(db.DateTime, nullable=False, default=dt.datetime.utcnow)
    active = db.Column(db.Boolean(), default=False)

    def __init__(self, email, password=None, **kwargs):
        """Create instance."""
        self.email = email
        self.set_password(password)

    def set_password(self, password):
        """Set password."""
        self.password = bcrypt.generate_password_hash(password)

    def check_password(self, value):
        """Check password."""
        return bcrypt.check_password_hash(self.password, value)

    def __repr__(self):
        """Represent instance as a unique string."""
        return f"<User({self.email!r})>"
