-
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.
Merge branch 'master' into robin/update-docs
- Loading branch information
Showing
127 changed files
with
2,364 additions
and
963 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, | ||
), | ||
] |
18 changes: 18 additions & 0 deletions
18
backend/samfundet/migrations/0010_recruitment_promo_media.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,18 @@ | ||
# Generated by Django 5.1.1 on 2024-10-31 19:56 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('samfundet', '0009_recruitmentpositionsharedinterviewgroup_name_en_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='recruitment', | ||
name='promo_media', | ||
field=models.CharField(blank=True, default=None, help_text='Youtube video id', max_length=11, null=True), | ||
), | ||
] |
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
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.