1
0
Fork 0
mirror of https://codeberg.org/Mo8it/AdvLabDB.git synced 2024-12-20 23:41:20 +00:00
This commit is contained in:
Mo 2022-05-21 18:44:53 +02:00
parent 18ae6bacb0
commit d7886eb773

View file

@ -568,7 +568,7 @@ class PartStudentView(SecureAdminModelView):
def partStudentQueryFactory(): def partStudentQueryFactory():
return PartStudent.query.filter(PartStudent.part.has(Part.semester == current_user.active_semester)) return PartStudent.query.join(Part).where(Part.semester == current_user.active_semester)
class ProgramRowFilter(FilterEqual): class ProgramRowFilter(FilterEqual):
@ -589,12 +589,12 @@ class GroupView(SecureAdminModelView):
if is_created: if is_created:
def query_factory(): def query_factory():
return partStudentQueryFactory().filter(PartStudent.group == None) return partStudentQueryFactory().where(PartStudent.group == None)
else: else:
def query_factory(): def query_factory():
return partStudentQueryFactory().filter( return partStudentQueryFactory().where(
or_( or_(
and_(PartStudent.group == None, PartStudent.part.has(Part.program == group.program)), and_(PartStudent.group == None, PartStudent.part.has(Part.program == group.program)),
PartStudent.group == group, PartStudent.group == group,