Skip to content

Commit

Permalink
Use walrus operators
Browse files Browse the repository at this point in the history
  • Loading branch information
mgax committed Mar 27, 2024
1 parent d7126a0 commit 05d6f02
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions ietf/utils/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,9 @@ class MainMenuSection(StructBlock):

class AccessibleChartValue(StructValue):
def aria_label(self):
label = self.get("accessible_label")
if not label:
if not (label := self.get("accessible_label")):
label = "A chart"
title = self.get("title")
if title:
if title := self.get("title"):
label += f" of {title}"

return label
Expand Down

0 comments on commit 05d6f02

Please sign in to comment.