User edited file: "app/users/models.py":

```diff
@@ -1,4 +1,4 @@
-from datetime import datetime
+from datetime import datetime, timedelta
 
 from app import db, bcrypt
 from app.utils.misc import make_code
@@ -37,4 +37,4 @@
     db.UniqueConstraint('user', 'code', name='uni_user_code')
 
     def __init__(self, user):
-        self.user = user
+        self.user = user
```

User edited file: "app/users/models.py":

```diff
@@ -2,6 +2,10 @@
 
 from app import db, bcrypt
 from app.utils.misc import make_code
+
+
+def expiration_date():
+    return datetime.now() + timedelta(days=1)
 
 
 class User(db.Model):

```
```app/users/models.py
from datetime import datetime, timedelta

from app import db, bcrypt
from app.utils.misc import make_code


def expiration_date():
    return datetime.now() + timedelta(days=1)


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.active = True
        self.is_admin = is_admin
        self.set_password(password)

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

    def deactivate(self):
        self.active = False


class PasswordReset(db.Model):

    id = db.Column(db.Integer(), primary_key=True)
    user_id = db.Column(db.Integer(), db.ForeignKey('user.id'))
    code = db.Column(db.String(255), unique=True, default=make_code)
    <|user_cursor_is_here|>
    date = db.Column(db.DateTime(), default=datetime.now)

    user = db.relationship(User)

    db.UniqueConstraint('user', 'code', name='uni_user_code')

    def __init__(self, user):
        self.user = user
```
```app/users/models.py
from datetime import datetime, timedelta

from app import db, bcrypt
from app.utils.misc import make_code


def expiration_date():
    return datetime.now() + timedelta(days=1)


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.active = True
        self.is_admin = is_admin
        self.set_password(password)

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

    def deactivate(self):
        self.active = False


class PasswordReset(db.Model):

    id = db.Column(db.Integer(), primary_key=True)
    user_id = db.Column(db.Integer(), db.ForeignKey('user.id'))
    code = db.Column(db.String(255), unique=True, default=make_code)
    <|tool_call|>
    {"name": "refactor.rename", "arguments": {"symbol": "datetime.now", "newName": "expiration_date"}}
    </|tool_call|>
    date = db.Column(db.DateTime(), default=datetime.now)

    user = db.relationship(User)

    db.UniqueConstraint('user', 'code', name='uni_user_code')

    def __init__(self, user):
        self.user = user
```