Skip to content

Commit

Permalink
add formating fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
magsyg committed Feb 13, 2024
1 parent 2426131 commit 947dda8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
8 changes: 5 additions & 3 deletions backend/samfundet/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ def fixture_gang(fixture_organization: Organization) -> Iterator[Gang]:
yield organization
organization.delete()


@pytest.fixture
def fixture_gang2(fixture_organization: Organization) -> Iterator[Gang]:
organization = Gang.objects.create(
Expand Down Expand Up @@ -279,6 +280,7 @@ def fixture_recruitment_position(fixture_recruitment: Recruitment, fixture_gang:
yield recruitment_position
recruitment_position.delete()


@pytest.fixture
def fixture_recruitment_position2(fixture_recruitment: Recruitment, fixture_gang2: Gang) -> Iterator[Recruitment]:
recruitment_position2 = RecruitmentPosition.objects.create(
Expand All @@ -298,6 +300,7 @@ def fixture_recruitment_position2(fixture_recruitment: Recruitment, fixture_gang
yield recruitment_position2
recruitment_position2.delete()


@pytest.fixture
def fixture_informationpage() -> Iterator[InformationPage]:
informationpage = InformationPage.objects.create(title_nb='Norsk tittel', title_en='Engel', slug_field='Sygard')
Expand Down Expand Up @@ -336,6 +339,7 @@ def fixture_recruitment_admission(
yield admission
admission.delete()


@pytest.fixture
def fixture_recruitment_admission2(
fixture_user: User,
Expand Down Expand Up @@ -390,9 +394,7 @@ def fixture_table(fixture_venue: Venue) -> Iterator[Table]:


@pytest.fixture
def fixture_reservation(
fixture_venue: Venue, fixture_table: Table,
fixture_date_monday: datetime) -> Iterator[Reservation]:
def fixture_reservation(fixture_venue: Venue, fixture_table: Table, fixture_date_monday: datetime) -> Iterator[Reservation]:
reservation = Reservation.objects.create(
venue=fixture_venue,
table=fixture_table,
Expand Down
4 changes: 2 additions & 2 deletions backend/samfundet/models/recruitment.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,9 @@ def update_priority(self, direction: int) -> None:
admissions_for_user = RecruitmentAdmission.objects.filter(recruitment=self.recruitment, user=self.user)
# Use order for more simple an unified for direction
admissions_for_user = admissions_for_user.order_by('-applicant_priority') if (direction > 0) else admissions_for_user.order_by('applicant_priority')
direction = abs(direction) # convert to absolute
direction = abs(direction) # convert to absolute
for i in range(len(admissions_for_user)):
if admissions_for_user[i].id == self.id: # find current
if admissions_for_user[i].id == self.id: # find current
switch = 0
# Find index of which to switch priority with
if i + direction >= len(admissions_for_user):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next';
import { useParams } from 'react-router-dom';
import { Button, Page } from '~/Components';
import { Table } from '~/Components/Table';
import { getRecruitmentAdmissionsForApplicant, putRecruitmentAdmission, putRecruitmentPriorityForUser } from '~/api';
import { getRecruitmentAdmissionsForApplicant, putRecruitmentPriorityForUser } from '~/api';
import { RecruitmentAdmissionDto, UserPriorityDto } from '~/dto';
import { KEY } from '~/i18n/constants';
import { ROUTES } from '~/routes';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export function RecruitmentPositionOverviewPage() {
content: (
<InputField
value={admission.interview.interview_time ? utcTimestampToLocal(admission.interview.interview_time) : ''}
onBlur={() => putRecruitmentAdmissionForGang(admission.id.toString(), admission)}
onBlur={() => putRecruitmentAdmissionForGang(admission.id, admission)}
onChange={(value: string) => {
const updatedInterview = { ...admission.interview, interview_time: value.toString() };
const newAdmission = { ...admission, interview: updatedInterview };
Expand All @@ -106,7 +106,7 @@ export function RecruitmentPositionOverviewPage() {
content: (
<InputField
value={admission.interview.interview_location ?? ''}
onBlur={() => putRecruitmentAdmissionForGang(admission.id.toString(), admission)}
onBlur={() => putRecruitmentAdmissionForGang(admission.id, admission)}
onChange={(value: string) => {
const updatedInterview = { ...admission.interview, interview_location: value.toString() };
const newAdmission = { ...admission, interview: updatedInterview };
Expand All @@ -123,7 +123,7 @@ export function RecruitmentPositionOverviewPage() {
onChange={(value) => {
const newAdmission = { ...admission, recruiter_priority: value };
setRecruitmentApplicants(immutableSet(recruitmentApplicants, admission, newAdmission));
putRecruitmentAdmissionForGang(admission.id.toString(), newAdmission);
putRecruitmentAdmissionForGang(admission.id, newAdmission);
}}
/>
),
Expand All @@ -136,7 +136,7 @@ export function RecruitmentPositionOverviewPage() {
onChange={(value) => {
const newAdmission = { ...admission, recruiter_status: value };
setRecruitmentApplicants(immutableSet(recruitmentApplicants, admission, newAdmission));
putRecruitmentAdmissionForGang(admission.id.toString(), newAdmission);
putRecruitmentAdmissionForGang(admission.id, newAdmission);
}}
/>
),
Expand Down

0 comments on commit 947dda8

Please sign in to comment.