From cbda7e63ae1c3e56d79a0b4803712e3c31fd14e7 Mon Sep 17 00:00:00 2001 From: Mo8it Date: Wed, 23 Feb 2022 20:36:29 +0100 Subject: [PATCH] Add changing password for assistants --- DB.drawio | 2 +- advlabdb/adminModelViews.py | 19 +++++++--------- advlabdb/assistantModelViews.py | 39 ++++++++++++++++++++++++--------- advlabdb/models.py | 4 ++-- advlabdb/utils.py | 4 ++++ 5 files changed, 44 insertions(+), 24 deletions(-) diff --git a/DB.drawio b/DB.drawio index 32bac07..4cdcf8c 100644 --- a/DB.drawio +++ b/DB.drawio @@ -1 +1 @@ -7Z1vd5vG0sA/jc9pfY5z+C94GTuOm8bp48rtbdM3PkggixgJBaHYzqd/QBJIYgcEYlkG7/a091pYQmtm5re7M7MzZ+rV7OUmtBfTL4Hj+meK5LycqR/OFEWWFDn+v+TK6+aKbiqbC4+h52zftLtw7/10009ur648x10evDEKAj/yFocXx8F87o6jg2t2GAbPh2+bBP7hty7sR5e4cD+2ffLqP54TTbdXDUna/eI313ucpl+tpL+Z2em7txeWU9sJnvcuqddn6lUYBNHmp9nLlesnTy99MJvPfSz4bTay0J1HVT7wafHRtEN7Mvkyf7wfj74Or80/LrZ3+WH7q+1fvIxWTnLHzZij1/RJxMNfJD9G9ii5dLmM7DDaCkyV4guxCCLbm7thfEFev/Z9e7H01m/fXJl6vnNrvwarKL1R+upy4r24znAjr+S9sehu45slL5ObT+Kb328Hk/za9r3HefzzOB5q8o2XobuMx3JrL6PtOyae718FfhCuh69eKlfW+8v1uMPgyd37zcA0379Xt9+xd10zNEv/EF8nH3T61Nwwcl/2Lm0f/I0bzNwofI3fsv1tphWvh+r9vNMpRdtem+6pk5petLd6/Jjdeifp+IetsGsIXiEEXyjx+C+PPNsfxvZlzx/Xwj+UbSIgJwwWf9nhoxttLywCLxHN9Y/4qWVS3JPJPJgnd4qCxfaXvjtJPzsKoiiYpZqwfRzZTdePQr+M/40fzpX0Tj+LxaRcxa/l3eu15BZBGEt0Hos8VszkHm6s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T6rzroi1mPqDcOiRnpL+aKvTEKukxNoMrNFg4d2+/PmfefV0cXvz3bh7De8AYH0l3yJPidxFTKZH/UXszZMXkbeS3/eF9y5TenUXkB+NRsbypFBGSMNOv2N3OARTWBtUYonjvEu9+DpKxYMPkQMv7S4Uvy3A+043zLO9pBJNd84O5IImr+ibOCJzJM/A6j4Fw3lnG9r2H2tPs7QQxdV5BruA5do96Vjj42wRzZbjYuZIc5ac2ENubbw80cdN3h6Ek74/XZZAl2cYSg8sPv404cLDEFWL1IJWEWodhAomobZvEBI1YpgnGTFMY19Pdr1jhKhznaB0ROYUCn71sKmL4nnV2+XVBQGW0T0lsIDK8OVymsXq1KJ0SqdzcR/vZBvv7P2mut13fAmRokTPVuM6Jy8nnjtNSDddBMHqDDtZMDfyOhmz7a7T1yrBHH2iqCHBdFv5c5kknm6f5qAnk0y39W2/97r7ohV2rgp5GYVhvPtxYrbjL+EwKc92/f8= \ No newline at end of file diff --git a/advlabdb/adminModelViews.py b/advlabdb/adminModelViews.py index c05578e..424e982 100644 --- a/advlabdb/adminModelViews.py +++ b/advlabdb/adminModelViews.py @@ -38,6 +38,7 @@ from advlabdb.models import ( User, ) from advlabdb.utils import ( + flashRandomPassword, initActiveSemesterMenuLinks, randomPassword, setUserActiveSemester, @@ -72,8 +73,8 @@ class UserView(SecureAdminModelView): last_name = StringField("Last Name", validators=[DataRequired()]) phone_number = StringField("Phone Number") mobile_phone_number = StringField("Mobile Phone Number") - room = StringField("Room") building = StringField("Building") + room = StringField("Room") semester_experiments = QuerySelectMultipleField( "Semester Experiments", @@ -114,8 +115,8 @@ class UserView(SecureAdminModelView): column_details_list = column_list + [ "phone_number", "mobile_phone_number", - "room", "building", + "room", "create_datetime", "update_datetime", ] @@ -136,9 +137,6 @@ class UserView(SecureAdminModelView): form = self.CreateForm return form(get_form_data(), obj=obj) - def flashPassword(password): - flash(f"Random password: {password}", category="warning") - def create_model(self, form): try: password = randomPassword() @@ -156,8 +154,8 @@ class UserView(SecureAdminModelView): last_name=form.last_name.data, phone_number=form.phone_number.data, mobile_phone_number=form.mobile_phone_number.data, - room=form.room.data, building=form.building.data, + room=form.room.data, active=form.active.data, active_semester=form.active_semester.data, ) @@ -174,7 +172,7 @@ class UserView(SecureAdminModelView): category="success", ) - UserView.flashPassword(password) + flashRandomPassword(password) self.after_model_change(form, model, True) return model @@ -193,12 +191,11 @@ class UserView(SecureAdminModelView): if hasattr(form, "generate_new_password") and form.generate_new_password.data: password = randomPassword() - UserView.flashPassword(password) admin_change_password( model, password, notify=False - ) # Password is automatically hashed with this method + ) # Password is automatically hashed with this function if model.has_role("assistant") and not model.assistant: semester_experiments = form.semester_experiments.data if form.semester_experiments else [] @@ -522,8 +519,8 @@ class ExperimentView(SecureAdminModelView): column_details_list = column_list + [ "description", "wiki_link", - "room", "building", + "room", "responsibility", "duration_in_days", "oral_weighting", @@ -614,8 +611,8 @@ class AssistantView(SecureAdminModelView): column_details_list = column_list + [ "user.phone_number", "user.mobile_phone_number", - "user.room", "user.building", + "user.room", "appointments", "experiment_marks", ] diff --git a/advlabdb/assistantModelViews.py b/advlabdb/assistantModelViews.py index e4fb142..52cca84 100644 --- a/advlabdb/assistantModelViews.py +++ b/advlabdb/assistantModelViews.py @@ -1,7 +1,7 @@ from flask import flash from flask_admin import expose from flask_admin.contrib.sqla.fields import QuerySelectField, QuerySelectMultipleField -from flask_security import current_user +from flask_security import admin_change_password, current_user from sqlalchemy import and_ from wtforms import BooleanField, Form, RadioField, SelectField, StringField from wtforms.fields import DateField @@ -26,7 +26,12 @@ from advlabdb.models import ( Student, User, ) -from advlabdb.utils import initActiveSemesterMenuLinks, userActiveSemester +from advlabdb.utils import ( + flashRandomPassword, + initActiveSemesterMenuLinks, + randomPassword, + userActiveSemester, +) class AssistantAppointmentView(SecureAssistantModelView): @@ -127,30 +132,44 @@ class AssistantExperimentMarkView(SecureAssistantModelView): class AssistantUserView(SecureAssistantModelView): + class EditForm(Form): + phone_number = StringField("Phone Number") + mobile_phone_number = StringField("Mobile Phone Number") + + building = StringField("Building") + room = StringField("Room") + + generate_new_password = BooleanField("Generate new random password", default=False) + + form = EditForm + + can_edit = True + column_display_actions = True + column_sortable_list = [] column_list = [ "email", "phone_number", "mobile_phone_number", - "room", "building", + "room", "assistant.semester_experiments", ] column_labels = { "assistant.semester_experiments": "Semester Experiments", } - column_editable_list = [ - "phone_number", - "mobile_phone_number", - "room", - "building", - ] - def queryFilter(self): return User.id == current_user.id + def on_model_change(self, form, model, is_created): + if form.generate_new_password.data: + password = randomPassword() + flashRandomPassword(password) + + admin_change_password(model, password, notify=False) # Password is automatically hashed with this function + class AssistantDocsView(SecureAssistantBaseView): @expose("/", methods=["GET"]) diff --git a/advlabdb/models.py b/advlabdb/models.py index 4a56f6f..2af0867 100644 --- a/advlabdb/models.py +++ b/advlabdb/models.py @@ -234,8 +234,8 @@ class Experiment(db.Model): title = db.Column(db.String(200), nullable=False) description = db.Column(db.Text, nullable=True) wiki_link = db.Column(db.String(300), nullable=True) - room = db.Column(db.String(100), nullable=False) building = db.Column(db.String(100), nullable=False) + room = db.Column(db.String(100), nullable=False) responsibility = db.Column(db.String(200), nullable=True) duration_in_days = db.Column(db.Integer, db.CheckConstraint("duration_in_days > -1"), nullable=False) active = db.Column(db.Boolean, default=True, nullable=False) @@ -522,8 +522,8 @@ class User(db.Model, FsUserMixin): last_name = db.Column(db.String(100), nullable=False) phone_number = db.Column(db.String(50), nullable=True) mobile_phone_number = db.Column(db.String(50), nullable=True) - room = db.Column(db.String(100), nullable=True) building = db.Column(db.String(100), nullable=True) + room = db.Column(db.String(100), nullable=True) active_semester_id = db.Column(db.Integer, db.ForeignKey("semester.id"), nullable=True) diff --git a/advlabdb/utils.py b/advlabdb/utils.py index 63c50d0..4918485 100644 --- a/advlabdb/utils.py +++ b/advlabdb/utils.py @@ -13,6 +13,10 @@ def randomPassword(): return "".join(choice(ascii_letters + digits) for i in range(12)) +def flashRandomPassword(password): + flash(f"Random password: {password}", category="warning") + + def userActiveSemester(flashWarning=False): lastSemesterId = ( Semester.query.order_by(Semester.year.desc()).order_by(Semester.label.desc()).first().id