diff --git a/webapp/repositories.py b/webapp/repositories.py index 4fe232e..9098720 100644 --- a/webapp/repositories.py +++ b/webapp/repositories.py @@ -70,6 +70,12 @@ def get_by_id(self, group_id: int) -> Group: group = session.query(Group).get(group_id) return group + def rename(self, group_id: int, title: str): + with self.db.create_session() as session: + session.query(Group) \ + .filter_by(id=group_id) \ + .update(dict(title=title)) + def create_by_names(self, names: list[str]): for name in names: self.create(name) @@ -519,7 +525,9 @@ def create_external(self, email: str, provider: str) -> Student: def update_group(self, student: Student, group: str | None): with self.db.create_session() as session: - session.query(Student).filter_by(id=student.id).update(dict(group=group)) + session.query(Student) \ + .filter_by(id=student.id) \ + .update(dict(group=group)) class MailerRepository: diff --git a/webapp/templates/teacher/exam.jinja b/webapp/templates/teacher/exam.jinja index 3b23eab..4a4f14c 100644 --- a/webapp/templates/teacher/exam.jinja +++ b/webapp/templates/teacher/exam.jinja @@ -24,6 +24,20 @@ +
{% elif seed.active == false %}