5
3
mirror of https://github.com/tildeverse/lobsters synced 2024-06-14 21:16:37 +00:00

deleting + undeleting shouldn't allow users to save invalid stories

This commit is contained in:
Peter Bhat Harkins 2022-02-11 09:23:33 -06:00
parent e112c58893
commit 18bc9b8ba9

View File

@ -43,7 +43,7 @@ class StoriesController < ApplicationController
@story.is_deleted = true
@story.editor = @user
if @story.save(:validate => false)
if @story.save
Keystore.increment_value_for("user:#{@story.user.id}:stories_deleted")
end
@ -232,7 +232,7 @@ class StoriesController < ApplicationController
@story.is_deleted = false
@story.editor = @user
if @story.save(:validate => false)
if @story.save
Keystore.increment_value_for("user:#{@story.user.id}:stories_deleted", -1)
end