misc: fix simplifiable-if-expression pylint errors (#56288)
This commit is contained in:
parent
f334721b8c
commit
e3631bc285
|
@ -111,7 +111,7 @@ def get_calendar(events, offset, days_displayed, min_duration):
|
|||
else:
|
||||
day = calendar.get_day(event_datetime.date())
|
||||
# add slots to day
|
||||
day.add_slots(DaySlot(event_datetime, True if not event.get('disabled', True) else False))
|
||||
day.add_slots(DaySlot(event_datetime, bool(not event.get('disabled', True))))
|
||||
|
||||
return calendar
|
||||
|
||||
|
|
|
@ -415,7 +415,7 @@ class PageDeleteView(DeleteView):
|
|||
def get_context_data(self, **kwargs):
|
||||
subpages = Page.objects.filter(parent=self.get_object().id)
|
||||
context = super().get_context_data()
|
||||
context['display_choice'] = True if subpages else False
|
||||
context['display_choice'] = bool(subpages)
|
||||
return context
|
||||
|
||||
def get_success_url(self):
|
||||
|
|
Loading…
Reference in New Issue