misc: fix simplifiable-if-expression pylint errors (#56288)

This commit is contained in:
Lauréline Guérin 2021-08-30 11:34:11 +02:00
parent f334721b8c
commit e3631bc285
No known key found for this signature in database
GPG Key ID: 1FAB9B9B4F93D473
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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):