code styling
This commit is contained in:
@@ -73,9 +73,8 @@ class NewsForm(PostForm):
|
|||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super().__init__(*args, **kwargs) # to get the self.fields set
|
super().__init__(*args, **kwargs) # to get the self.fields set
|
||||||
self.fields["author"].queryset = self.fields["author"].queryset.order_by(
|
author_qs = self.fields["author"].queryset.order_by("username")
|
||||||
"username"
|
self.fields["author"].queryset = author_qs
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class EventForm(PostForm):
|
class EventForm(PostForm):
|
||||||
@@ -125,9 +124,8 @@ class EventForm(PostForm):
|
|||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super().__init__(*args, **kwargs) # to get the self.fields set
|
super().__init__(*args, **kwargs) # to get the self.fields set
|
||||||
self.fields["author"].queryset = self.fields["author"].queryset.order_by(
|
author_qs = self.fields["author"].queryset.order_by("username")
|
||||||
"username"
|
self.fields["author"].queryset = author_qs
|
||||||
)
|
|
||||||
|
|
||||||
self.fields["event_start"].required = True
|
self.fields["event_start"].required = True
|
||||||
self.fields["event_end"].required = False
|
self.fields["event_end"].required = False
|
||||||
|
|||||||
Reference in New Issue
Block a user