Skip to content

Commit

Permalink
[AIRFLOW-3067] Display www_rbac Flask flash msg properly (#3903)
Browse files Browse the repository at this point in the history
The Flask flash messages are not displayed properly.

When we don't give a category for a flash message, defautl
value will be 'message'. In some cases, we specify 'error'
category.

Using Flask-AppBuilder, the flash message will be given
a CSS class 'alert-[category]'. But We don't have
'alert-message' or 'alert-error' in the current
'bootstrap-theme.css' file.

This makes the the flash messages in www_rbac UI come with
no background color.

This commit addresses this issue by adding 'alert-message'
(using specs of existing CSS class 'alert-info') and
'alert-error' (using specs of existing CSS class 'alert-danger')
into 'bootstrap-theme.css'.
  • Loading branch information
XD-DENG authored and kaxil committed Jan 19, 2019
1 parent ea00096 commit 878c9b7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions airflow/www_rbac/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2231,10 +2231,9 @@ def action_set_running(self, drs, session=None):
dr.state = State.RUNNING
models.DagStat.update(dirty_ids, session=session)
session.commit()
flash(
"{count} dag runs were set to running".format(**locals()))
flash("{count} dag runs were set to running".format(**locals()))
except Exception as ex:
flash(str(ex))
flash(str(ex), 'error')
flash('Failed to set state', 'error')
return redirect(self.route_base + '/list')

Expand Down

0 comments on commit 878c9b7

Please sign in to comment.