Skip to content

Commit be2843c

Browse files
committed
Create admin profile
1 parent 0c6ccc6 commit be2843c

File tree

5 files changed

+9
-0
lines changed

5 files changed

+9
-0
lines changed

My_path_team9/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@ def create_app(config):
2323
from .main import main_bp
2424
from .student import student_bp
2525
from .teacher import teacher_bp
26+
from .admin import admin_bp
2627
from .errors import register_error_handlers
2728

2829
app.register_blueprint(auth_bp)
2930
app.register_blueprint(main_bp)
3031
app.register_blueprint(student_bp)
3132
app.register_blueprint(teacher_bp)
33+
app.register_blueprint(admin_bp)
3234
register_error_handlers(app)
3335

3436
return app

My_path_team9/admin/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from flask import Blueprint
2+
3+
admin_bp = Blueprint('admin', __name__,template_folder='templates', url_prefix='/admin')
4+
5+
from . import routes

My_path_team9/admin/forms.py

Whitespace-only changes.

My_path_team9/admin/models.py

Whitespace-only changes.

My_path_team9/auth/routes.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ def login():
4040
return redirect(url_for('student.survey'))
4141
elif user.role == 'teacher':
4242
return redirect(url_for('teacher.dashboard'))
43+
elif user.role == 'admin':
44+
return redirect(url_for('admin.dashboard'))
4345
else:
4446
return redirect(url_for('main_bp.index'))
4547

0 commit comments

Comments
 (0)