X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/baf10cd39289cd7e94a819305e46f43e85a136c6..5cbd4038edb32b0304bd766e70fc680ea447b52b:/app/controllers/redactions_controller.rb diff --git a/app/controllers/redactions_controller.rb b/app/controllers/redactions_controller.rb index b40c83e0d..8ba5c7d9d 100644 --- a/app/controllers/redactions_controller.rb +++ b/app/controllers/redactions_controller.rb @@ -52,12 +52,9 @@ class RedactionsController < ApplicationController end def destroy - unless @redaction.old_nodes.empty? && - @redaction.old_ways.empty? && - @redaction.old_relations.empty? - flash[:error] = t('redaction.destroy.not_empty') - redirect_to @redaction - else + if @redaction.old_nodes.empty? && + @redaction.old_ways.empty? && + @redaction.old_relations.empty? if @redaction.destroy flash[:notice] = t('redaction.destroy.flash') redirect_to :redactions @@ -65,6 +62,9 @@ class RedactionsController < ApplicationController flash[:error] = t('redaction.destroy.error') redirect_to @redaction end + else + flash[:error] = t('redaction.destroy.not_empty') + redirect_to @redaction end end