X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/18c70fa2ded1fbad78d108794800be0309bbf499..db52805f97b9134a66fe1b1240d81e1e6f60736a:/app/controllers/diary_entries_controller.rb diff --git a/app/controllers/diary_entries_controller.rb b/app/controllers/diary_entries_controller.rb index 312e1e54c..467c4a38f 100644 --- a/app/controllers/diary_entries_controller.rb +++ b/app/controllers/diary_entries_controller.rb @@ -60,9 +60,8 @@ class DiaryEntriesController < ApplicationController @title = t "diary_entries.edit.title" @diary_entry = DiaryEntry.find(params[:id]) - if current_user != @diary_entry.user - redirect_to diary_entry_path(@diary_entry.user, @diary_entry) - elsif params[:diary_entry] && @diary_entry.update(entry_params) + if current_user != @diary_entry.user || + (params[:diary_entry] && @diary_entry.update(entry_params)) redirect_to diary_entry_path(@diary_entry.user, @diary_entry) else set_map_location