Validation for screenshot reporting form fixed
This commit is contained in:
parent
94377cdc28
commit
b57ed7ce1b
1 changed files with 7 additions and 2 deletions
|
|
@ -180,8 +180,13 @@ class PackagesController < ApplicationController
|
|||
if verify_recaptcha
|
||||
@screenshot.delete_reason = params[:delete_reason]
|
||||
@screenshot.markedfordelete = true
|
||||
@screenshot.save!
|
||||
flash['notice'] = "Screenshot reported. The moderators will deal with it."
|
||||
if @screenshot.valid?
|
||||
@screenshot.save!
|
||||
flash['notice'] = "Screenshot reported. The moderators will deal with it."
|
||||
else
|
||||
errors = @screenshot.errors.to_a.join(' and ')
|
||||
flash['alert'] = "Sorry. #{errors}"
|
||||
end
|
||||
end
|
||||
redirect_to :back
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue