-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add adminpanel for shared interviewgroup * first draft * fix * fix * fix * fix migration * more fix * fix * fix * feat: fix * fix * fix * fucking paths * fuck this * lol fix * it works? * fix up merge * fix requests --------- Co-authored-by: magsyg <[email protected]>
- Loading branch information
Showing
25 changed files
with
353 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
backend/root/management/commands/seed_scripts/recruitment_sharedinterviewgroups.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from __future__ import annotations | ||
|
||
import random | ||
|
||
from root.utils.samfundet_random import words | ||
|
||
from samfundet.models.recruitment import Recruitment, RecruitmentPosition, RecruitmentPositionSharedInterviewGroup | ||
|
||
|
||
def seed(): | ||
yield 0, 'recruitment_positions_shared_interview' | ||
RecruitmentPositionSharedInterviewGroup.objects.all().delete() | ||
yield 0, 'Deleted old recruitmentpositionsharedgroup' | ||
|
||
recruitments = Recruitment.objects.all() | ||
created_count = 0 | ||
for recruitment in recruitments: | ||
for i in range(3): | ||
RecruitmentPositionSharedInterviewGroup.objects.create(recruitment=recruitment, name_nb=f'{words(2)} {i}', name_en=f'{words(2)} {i}') | ||
created_count += 1 | ||
shared_groups = list(RecruitmentPositionSharedInterviewGroup.objects.filter(recruitment=recruitment)) | ||
positions = random.sample(list(RecruitmentPosition.objects.filter(recruitment=recruitment)), 6) | ||
for pos in positions: | ||
pos.shared_interview_group = random.choice(shared_groups) | ||
pos.save() | ||
|
||
yield 100, f'Created {created_count} recruitment_position_shared_groups' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
...end/samfundet/migrations/0009_recruitmentpositionsharedinterviewgroup_name_en_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Generated by Django 5.1.1 on 2024-10-29 17:39 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("samfundet", "0008_event_entrance_en_event_entrance_nb"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="recruitmentpositionsharedinterviewgroup", | ||
name="name_en", | ||
field=models.CharField( | ||
default="hi", | ||
help_text="Name of the recruitmentgroup (EN)", | ||
max_length=100, | ||
), | ||
preserve_default=False, | ||
), | ||
migrations.AddField( | ||
model_name="recruitmentpositionsharedinterviewgroup", | ||
name="name_nb", | ||
field=models.CharField( | ||
default="hi", | ||
help_text="Name of the recruitmentgroup (NB)", | ||
max_length=100, | ||
), | ||
preserve_default=False, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.