Skip to content

Commit

Permalink
Rewrap some stuff.
Browse files Browse the repository at this point in the history
This placates black.
  • Loading branch information
colons committed Mar 10, 2024
1 parent e511d6f commit baf4185
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions nkdsu/apps/vote/views/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,9 @@ class MigrateAwayFrom(TrackSpecificAdminMixin, FormView):
template_name = 'migrate_away_from.html'

def get_possible_targets(self) -> TrackQuerySet:
return Track.objects.filter(hidden=True, inudesu=False).exclude(pk=self.kwargs['pk'])
return Track.objects.filter(hidden=True, inudesu=False).exclude(
pk=self.kwargs['pk']
)

def get_form_class(self) -> type[forms.Form]:
class TrackMigrationTargetForm(forms.Form):
Expand All @@ -635,7 +637,9 @@ class TrackMigrationTargetForm(forms.Form):
return TrackMigrationTargetForm

def form_valid(self, form: forms.Form) -> HttpResponse:
target = get_object_or_404(self.get_possible_targets(), pk=form.cleaned_data['migration_target'])
target = get_object_or_404(
self.get_possible_targets(), pk=form.cleaned_data['migration_target']
)
call_command('migrate_away_from', self.get_track().pk, target.pk)
return redirect(target.get_absolute_url())

Expand Down

0 comments on commit baf4185

Please sign in to comment.