diff --git a/backend/samfundet/serializers.py b/backend/samfundet/serializers.py index ffd97b2c2..d8e3447d0 100644 --- a/backend/samfundet/serializers.py +++ b/backend/samfundet/serializers.py @@ -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: @@ -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() @@ -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() @@ -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) @@ -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)