feat: Initial commit with full deployment architecture and scripts
This commit is contained in:
commit
abb3efe114
96 files changed
+16789
No files matched your search
@@ -0,0 +1,26 @@
|
||||
|
||||
from app import create_app, db
|
||||
from app.models import User
|
||||
|
||||
app = create_app()
|
||||
with app.app_context():
|
||||
# Check for admin user
|
||||
admin = User.query.filter_by(username='admin').first()
|
||||
if admin:
|
||||
print(f"Found admin user. Current role: {admin.role}")
|
||||
if admin.role != 'admin':
|
||||
admin.role = 'admin'
|
||||
db.session.commit()
|
||||
print("Updated admin user role to 'admin'")
|
||||
else:
|
||||
print("Admin user not found. Creating...")
|
||||
admin = User(username='admin', email='admin@example.com', role='admin')
|
||||
admin.set_password('Hxit@54321')
|
||||
db.session.add(admin)
|
||||
db.session.commit()
|
||||
print("Created admin user with role 'admin'")
|
||||
|
||||
# Also check if there are other users that should be admin but aren't
|
||||
users = User.query.all()
|
||||
for u in users:
|
||||
print(f"User: {u.username}, Role: {u.role}")
|
||||
Reference in new issue
Block a user