diff --git a/backend/clubs/management/commands/populate.py b/backend/clubs/management/commands/populate.py index 5de5d06c5..a499bacef 100644 --- a/backend/clubs/management/commands/populate.py +++ b/backend/clubs/management/commands/populate.py @@ -664,10 +664,7 @@ def get_image(url): status_counter % len(ApplicationSubmission.STATUS_TYPES) ][0] ApplicationSubmission.objects.create( - status=status, - user=user, - application=application, - committee=None, + status=status, user=user, application=application, committee=None, ) status_counter += 1 for committee in application.committees.all(): @@ -751,7 +748,7 @@ def get_image(url): first_mship.save() count += 1 - # add tickets + # Add tickets hr = Club.objects.get(code="harvard-rejects") diff --git a/backend/clubs/serializers.py b/backend/clubs/serializers.py index 1f803a32a..f44761caa 100644 --- a/backend/clubs/serializers.py +++ b/backend/clubs/serializers.py @@ -2012,9 +2012,7 @@ def get_clubs(self, obj): # hide non public memberships if not superuser if user is None or not user.has_perm("clubs.manage_club"): queryset = queryset.filter( - membership__person=obj, - membership__public=True, - approved=True, + membership__person=obj, membership__public=True, approved=True, ) serializer = MembershipClubListSerializer( @@ -2415,8 +2413,7 @@ def save(self): ApplicationMultipleChoice.objects.filter(question=question_obj).delete() for choice in multiple_choice: ApplicationMultipleChoice.objects.create( - value=choice["value"], - question=question_obj, + value=choice["value"], question=question_obj, ) # manually create committee choices as Django does not @@ -2705,8 +2702,7 @@ def save(self): for name in committees: if name not in prev_committee_names: ApplicationCommittee.objects.create( - name=name, - application=application_obj, + name=name, application=application_obj, ) return application_obj diff --git a/backend/clubs/views.py b/backend/clubs/views.py index d970c062f..75344d516 100644 --- a/backend/clubs/views.py +++ b/backend/clubs/views.py @@ -1080,8 +1080,7 @@ def get_queryset(self): self.request.user, get_user_model() ): SearchQuery( - person=self.request.user, - query=self.request.query_params.get("search"), + person=self.request.user, query=self.request.query_params.get("search"), ).save() # select subset of clubs if requested @@ -1673,9 +1672,7 @@ def constitutions(self, request, *args, **kwargs): query = ( Club.objects.filter(badges=badge, archived=False) .order_by(Lower("name")) - .prefetch_related( - Prefetch("asset_set", to_attr="prefetch_asset_set"), - ) + .prefetch_related(Prefetch("asset_set", to_attr="prefetch_asset_set"),) ) if request.user.is_authenticated: query = query.prefetch_related( @@ -3225,9 +3222,7 @@ def destroy(self, request, *args, **kwargs): def get_queryset(self): return MembershipRequest.objects.filter( - person=self.request.user, - withdrew=False, - club__archived=False, + person=self.request.user, withdrew=False, club__archived=False, ) @@ -4351,9 +4346,7 @@ def get(self, request): try: response = zoom_api_call( - request.user, - "GET", - "https://api.zoom.us/v2/users/{uid}/settings", + request.user, "GET", "https://api.zoom.us/v2/users/{uid}/settings", ) except requests.exceptions.HTTPError as e: raise DRFValidationError( @@ -4474,9 +4467,7 @@ def get_operation_id(self, **kwargs): def get_object(self): user = self.request.user prefetch_related_objects( - [user], - "profile__school", - "profile__major", + [user], "profile__school", "profile__major", ) return user @@ -4909,9 +4900,7 @@ def question_response(self, *args, **kwargs): } ) submission = ApplicationSubmission.objects.create( - user=self.request.user, - application=application, - committee=committee, + user=self.request.user, application=application, committee=committee, ) for question_pk in questions: question = ApplicationQuestion.objects.filter(pk=question_pk).first() @@ -4932,9 +4921,7 @@ def question_response(self, *args, **kwargs): text = question_data.get("text", None) if text is not None and text != "": obj = ApplicationQuestionResponse.objects.create( - text=text, - question=question, - submission=submission, + text=text, question=question, submission=submission, ).save() response = Response(ApplicationQuestionResponseSerializer(obj).data) elif question_type == ApplicationQuestion.MULTIPLE_CHOICE: