Skip to content

Commit eac91d3

Browse files
author
rootgov
committed
Update user data fields to allow for optional names and longer password hashes
Modify the User model in models.py to make first_name and last_name nullable, and increase the password_hash field length to 256 characters. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 7e4aa02f-d866-4efb-bfc5-02b478b7e651 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/647fe97b-dcb3-4460-a83e-a704627f902a/7e4aa02f-d866-4efb-bfc5-02b478b7e651/RgXjEFc
2 parents 1663491 + 155aa16 commit eac91d3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

.replit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
run = "python3 main.py"
3-
modules = ["python-3.12"]
3+
modules = ["python-3.12", "postgresql-16"]
44

55
[nix]
66
channel = "stable-22_11"

models.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ class User(UserMixin, db.Model):
1818
id = db.Column(db.Integer, primary_key=True)
1919
username = db.Column(db.String(80), unique=True, nullable=False)
2020
email = db.Column(db.String(120), unique=True, nullable=False)
21-
password_hash = db.Column(db.String(128), nullable=False)
22-
first_name = db.Column(db.String(50), nullable=False)
23-
last_name = db.Column(db.String(50), nullable=False)
21+
password_hash = db.Column(db.String(256), nullable=False)
22+
first_name = db.Column(db.String(50), nullable=True)
23+
last_name = db.Column(db.String(50), nullable=True)
2424
role = db.Column(db.String(50), nullable=False, default="user")
2525
department_id = db.Column(db.Integer, db.ForeignKey("departments.id"))
2626
is_active = db.Column(db.Boolean, default=True)

0 commit comments

Comments
 (0)