old_contents: from datetime import datetime
  
  from app import db, bcrypt
  
  
  class User(db.Model):
  
      id = db.Column(db.Integer(), primary_key=True)
      email = db.Column(db.String(255), unique=True)
      password = db.Column(db.String(255))
      active = db.Column(db.Boolean())
      is_admin = db.Column(db.Boolean())
  
      def __init__(self, email, password, is_admin=False):
          self.email = email
          self.password = bcrypt.generate_password_hash(password)
          self.active = True
          self.is_admin = is_admin
  
      def deactivate(self):
          self.active = False
  
  
  class PasswordReset(db.Model):
  
      id = db.Column(db.Integer(), primary_key=True)
      user = db.Column(db.Integer(), db.ForeignKey('user.id'))
      code = db.Column(db.String(255), unique=True)
      date = db.Column(db.DateTime(default=datetime.now))
  
new_contents: from datetime import datetime
  
  from app import db, bcrypt
  
  
  class User(db.Model):
  
      id = db.Column(db.Integer(), primary_key=True)
      email = db.Column(db.String(255), unique=True)
      password = db.Column(db.String(255))
      active = db.Column(db.Boolean())
      is_admin = db.Column(db.Boolean())
  
      def __init__(self, email, password, is_admin=False):
          self.email = email
          self.password = bcrypt.generate_password_hash(password)
          self.active = True
          self.is_admin = is_admin
  
      def deactivate(self):
          self.active = False
  
  
  class PasswordReset(db.Model):
  
      id = db.Column(db.Integer(), primary_key=True)
      user = db.Column(db.Integer(), db.ForeignKey('user.id'))
      code = db.Column(db.String(255), unique=True)
      date = db.Column(db.DateTime(), default=datetime.now)
  
subject: Fix default