The if expression can be replaced with 'bool(test)'
285 ),
286 'cfp_open': True if p.cfp_state.OPEN else False,
287 'member_access': (
288 True289 if (p.features.rsvp_for_members or p.features.subscription)
290 else False
291 ),
The if expression can be replaced with 'bool(test)'
283 'venue': (
284 p.primary_venue.city if p.primary_venue else p.location
285 ),
286 'cfp_open': True if p.cfp_state.OPEN else False,287 'member_access': (
288 True
289 if (p.features.rsvp_for_members or p.features.subscription)
Description
The if
expression used here can be simplified to increase the code readability.
Example:
value = True if arg else False
This can be simplified into:
value = bool(arg)