From e26a788da883383a1663bfd60f5ecd8c5bed1e66 Mon Sep 17 00:00:00 2001 From: Patrick Mayr Date: Tue, 18 Jan 2022 10:29:24 +0000 Subject: [PATCH] code styling --- fet2020/posts/forms.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/fet2020/posts/forms.py b/fet2020/posts/forms.py index 4af8c780..9041c1bb 100644 --- a/fet2020/posts/forms.py +++ b/fet2020/posts/forms.py @@ -73,9 +73,8 @@ class NewsForm(PostForm): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) # to get the self.fields set - self.fields["author"].queryset = self.fields["author"].queryset.order_by( - "username" - ) + author_qs = self.fields["author"].queryset.order_by("username") + self.fields["author"].queryset = author_qs class EventForm(PostForm): @@ -125,9 +124,8 @@ class EventForm(PostForm): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) # to get the self.fields set - self.fields["author"].queryset = self.fields["author"].queryset.order_by( - "username" - ) + author_qs = self.fields["author"].queryset.order_by("username") + self.fields["author"].queryset = author_qs self.fields["event_start"].required = True self.fields["event_end"].required = False