1
0
Fork 0
mirror of https://codeberg.org/Mo8it/AdvLabDB.git synced 2024-11-08 21:21:06 +00:00

Removed email from Assistant

This commit is contained in:
Mo 2021-07-11 03:17:21 +02:00
parent dca0ec8828
commit aa7ab40f1e
5 changed files with 6 additions and 9 deletions

File diff suppressed because one or more lines are too long

View file

@ -52,7 +52,6 @@ This URL leads to the home page where you can login with this testing admin acco
# To-Do: # To-Do:
- Rest of admin model views - Rest of admin model views
- Calculate final experiment and part mark - Calculate final experiment and part mark
- Check if passed in GroupExperiment.checkAndInit
- Assistants space - Assistants space
- Deactivate assistants account after a while if not assigned to experiments - Deactivate assistants account after a while if not assigned to experiments
- Homepage text changeable - Homepage text changeable

View file

@ -124,7 +124,7 @@ class SemesterView(SecureModelView):
), ),
"transfer_assistants": BooleanField( "transfer_assistants": BooleanField(
"Transfer Assistants", "Transfer Assistants",
description="This option transfers assistants of your active semester to active experiments in the new semester. Make sure that your semester is the last semester before creating a new one (recommended)! Active experiments are transfered anyway. If you don't want an experiment to be transfered, set it to inactive before creating the new semester. Experiments which are switched to active before creating the new semester will be created in the new semester without assistants. It is important to check the assistants of all experiments after creating a new semester.", description="This option transfers assistants of your active semester to active experiments in the new semester. Make sure that your semester is the last semester before creating a new one (recommended)! Active experiments are transfered anyway. If you do not want an experiment to be transfered, set it to inactive before creating the new semester. Experiments which are switched to active before creating the new semester will be created in the new semester without assistants. It is important to check the assistants of all experiments after creating a new semester.",
default=True, default=True,
), ),
} }
@ -254,7 +254,7 @@ class PartStudentView(SecureModelView):
column_filters = ["part", "student", "group"] column_filters = ["part", "student", "group"]
partGroupPartMismatchException = "Part and groups part don't match!" partGroupPartMismatchException = "Student's part and group's part do not match!"
def create_form(self, obj=None): def create_form(self, obj=None):
form = self.CreateForm form = self.CreateForm
@ -299,7 +299,7 @@ class GroupView(SecureModelView):
column_list = ["number", "part", "part_students", "group_experiments"] column_list = ["number", "part", "part_students", "group_experiments"]
column_filters = ["number", "part"] column_filters = ["number", "part"]
partStudentPartPartMismatchException = "Part and StudentParts part don't match!" partStudentPartPartMismatchException = "Group's part and student's part do not match!"
def create_model(self, form): def create_model(self, form):
try: try:
@ -384,7 +384,7 @@ class SemesterExperimentView(SecureModelView):
class AssistantView(SecureModelView): class AssistantView(SecureModelView):
can_view_details = True can_view_details = True
column_list = ["first_name", "last_name", "email", "user", "semester_experiments"] column_list = ["first_name", "last_name", "user", "semester_experiments"]
column_details_list = column_list + [ column_details_list = column_list + [
"phone_number", "phone_number",
"mobile_phone_number", "mobile_phone_number",

View file

@ -149,7 +149,6 @@ class Assistant(db.Model):
id = db.Column(db.Integer, primary_key=True) id = db.Column(db.Integer, primary_key=True)
first_name = db.Column(db.String(100), nullable=False) first_name = db.Column(db.String(100), nullable=False)
last_name = db.Column(db.String(100), nullable=False) last_name = db.Column(db.String(100), nullable=False)
email = db.Column(db.String(200), nullable=False)
phone_number = db.Column(db.String(50), nullable=True) phone_number = db.Column(db.String(50), nullable=True)
mobile_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) room = db.Column(db.String(100), nullable=True)

View file

@ -93,12 +93,11 @@ with app.app_context():
as1 = Assistant( as1 = Assistant(
first_name="As1", first_name="As1",
last_name="l", last_name="l",
email="test@test.com",
phone_number="012333212", phone_number="012333212",
mobile_phone_number="012334123", mobile_phone_number="012334123",
user=us1, user=us1,
) )
as2 = Assistant(first_name="As2", last_name="l", email="test2@test.com", user=us2) as2 = Assistant(first_name="As2", last_name="l", user=us2)
as1.semester_experiments.append(sx1) as1.semester_experiments.append(sx1)
as2.semester_experiments.append(sx2) as2.semester_experiments.append(sx2)