Skip to content

Commit

Permalink
Handle plural
Browse files Browse the repository at this point in the history
  • Loading branch information
peloyeje committed Sep 22, 2023
1 parent 8edf8c2 commit 9e5a466
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions airflow/www/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -5884,7 +5884,7 @@ def action_clear(self, task_instances, session: Session = NEW_SESSION):
task_instances=task_instances, session=session, clear_downstream=False
)
session.commit()
flash(f"{count} task instances have been cleared")
flash(f"{count} task instance{'s have' if count > 1 else ' has'} been cleared")
except Exception as e:
flash(f'Failed to clear task instances: "{e}"', "error")

Expand All @@ -5911,8 +5911,8 @@ def action_clear_downstream(self, task_instances, session: Session = NEW_SESSION
)
session.commit()
flash(
f"Cleared {selected_ti_count} selected task instances + "
f"{downstream_ti_count} downstream dependencies"
f"Cleared {selected_ti_count} selected task instance{'s' if selected_ti_count > 1 else ''} "
f"and {downstream_ti_count} downstream dependencies"
)
except Exception as e:
flash(f'Failed to clear task instances: "{e}"', "error")
Expand Down

0 comments on commit 9e5a466

Please sign in to comment.