Skip to content

Commit

Permalink
Revert "chore: now its available to add allowed_students to the group"
Browse files Browse the repository at this point in the history
This reverts commit 4983b94.
  • Loading branch information
fivan999 committed Jan 14, 2025
1 parent 4983b94 commit 5f5161e
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 41 deletions.
3 changes: 1 addition & 2 deletions adminpage/api/crud/crud_training.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,14 @@ def can_check_in(
)
free_places = training.group.capacity - training.checkins.count()
allowed_medical_groups = training.group.allowed_medical_groups.all()
allowed_students = training.group.allowed_students.all()

# All conditions must be True for the student to be able to check in.
result = (
free_places > 0 and
training.start < (time_now + _week_delta) and time_now < training.end and
(total_hours + training.academic_duration) <= 4 and
(same_type_hours + training.academic_duration) <= 2 and
(student.medical_group in allowed_medical_groups or student in allowed_students) and
student.medical_group in allowed_medical_groups and
training.group.allowed_gender in (student.gender, -1)
)

Expand Down
2 changes: 0 additions & 2 deletions adminpage/sport/admin/groupAdmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ class GroupAdmin(DefaultFilterMixIn):
"sport",
# "trainer",
'trainers',
'allowed_students',
)

list_filter = (
Expand Down Expand Up @@ -129,7 +128,6 @@ class GroupAdmin(DefaultFilterMixIn):
"trainers",
"allowed_medical_groups",
"allowed_gender",
"allowed_students",
)

def get_changeform_initial_data(self, request):
Expand Down
18 changes: 0 additions & 18 deletions adminpage/sport/migrations/0124_group_allowed_students.py

This file was deleted.

18 changes: 0 additions & 18 deletions adminpage/sport/migrations/0125_alter_group_allowed_students.py

This file was deleted.

1 change: 0 additions & 1 deletion adminpage/sport/models/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class Group(models.Model):
default=-1,
verbose_name="Is a QR required?"
)
allowed_students = models.ManyToManyField('Student', related_name='allowed_groups', blank=True)

class Meta:
db_table = "group"
Expand Down

0 comments on commit 5f5161e

Please sign in to comment.