Prevent the cannot-overwrite error message from being removed before it can be seen (#626)

This commit is contained in:
x4base
2016-06-15 16:19:50 -05:00
committed by Maxime Beauchemin
parent aa2b8b42d0
commit ee2d3330aa
2 changed files with 4 additions and 2 deletions

View File

@@ -64,7 +64,9 @@ function query(force, pushState) {
}
$('.query-and-save button').attr('disabled', 'disabled');
$('.btn-group.results span,a').attr('disabled', 'disabled');
$('div.alert').remove();
if (force) { // Don't hide the alert message when the page is just loaded
$('div.alert').remove();
}
$('#is_cached').hide();
prepForm();
slice.render(force);

View File

@@ -842,7 +842,7 @@ class Caravel(BaseView):
def overwrite_slice(self, slc):
can_update = check_ownership(slc, raise_if_false=False)
if not can_update:
flash("You cannot overwrite [{}]".format(slc))
flash("You cannot overwrite [{}]".format(slc), "danger")
else:
session = db.session()
session.merge(slc)