Skip to content

Commit

Permalink
Undo unintentional formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
robines committed Nov 22, 2024
1 parent e50eaa2 commit eeb4b34
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions backend/samfundet/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,7 @@ def validate(self, attrs: dict) -> dict: # noqa: C901
if username and password:
# Try to authenticate the user using Django auth framework.
user = User.objects.create_user(
first_name=firstname, last_name=lastname, username=username, email=email, phone_number=phone_number,
password=password
first_name=firstname, last_name=lastname, username=username, email=email, phone_number=phone_number, password=password
)
user = authenticate(request=self.context.get('request'), username=username, password=password)
else:
Expand Down Expand Up @@ -733,8 +732,7 @@ class RecruitmentUpdateUserPrioritySerializer(serializers.Serializer):

class UserForRecruitmentSerializer(serializers.ModelSerializer):
applications = serializers.SerializerMethodField(method_name='get_applications', read_only=True)
applications_without_interview = serializers.SerializerMethodField(
method_name='get_applications_without_interviews_for_recruitment', read_only=True)
applications_without_interview = serializers.SerializerMethodField(method_name='get_applications_without_interviews_for_recruitment', read_only=True)
top_application = serializers.SerializerMethodField(method_name='get_top_application', read_only=True)
campus = CampusSerializer()

Expand Down Expand Up @@ -917,8 +915,7 @@ def get_processed_applicants(self, recruitment_position: RecruitmentPosition) ->

def get_accepted_applicants(self, recruitment_position: RecruitmentPosition) -> int:
return RecruitmentApplication.objects.filter(
recruitment_position=recruitment_position, withdrawn=False,
recruiter_status=RecruitmentStatusChoices.CALLED_AND_ACCEPTED
recruitment_position=recruitment_position, withdrawn=False, recruiter_status=RecruitmentStatusChoices.CALLED_AND_ACCEPTED
).count()


Expand Down Expand Up @@ -1156,8 +1153,7 @@ def update(self, instance: RecruitmentApplication, validated_data: dict) -> Recr
interview_data = validated_data.pop('interview', {})

interview_instance = instance.interview
interview_instance.interview_location = interview_data.get('interview_location',
interview_instance.interview_location)
interview_instance.interview_location = interview_data.get('interview_location', interview_instance.interview_location)
interview_instance.interview_time = interview_data.get('interview_time', interview_instance.interview_time)
interviewers_data = validated_data.pop('interviewers', [])
interview_instance.interviewers.set(interviewers_data)
Expand Down Expand Up @@ -1220,8 +1216,7 @@ def create(self, validated_data: dict) -> PurchaseFeedbackModel:
purchase_feedback = PurchaseFeedbackModel.objects.create(event=event, **validated_data)

for alternative, selected in alternatives_data.items():
PurchaseFeedbackAlternative.objects.create(form=purchase_feedback, alternative=alternative,
selected=selected)
PurchaseFeedbackAlternative.objects.create(form=purchase_feedback, alternative=alternative, selected=selected)

for question, answer in responses_data.items():
PurchaseFeedbackQuestion.objects.create(form=purchase_feedback, question=question, answer=answer)
Expand Down

0 comments on commit eeb4b34

Please sign in to comment.