Don't update last_buffered timestamp when creating a suggested tweet (#12537)
* Don't update last_buffered timestamp when creating a suggested tweet * Downcase email instead to rely on index
This commit is contained in:
parent
27f4d238cd
commit
39a63c17f2
2 changed files with 1 additions and 2 deletions
|
|
@ -12,7 +12,7 @@ module Admin
|
|||
email = params.dig(:user, :email)
|
||||
name = params.dig(:user, :name)
|
||||
|
||||
if User.exists?(["lower(email) = ? AND registered = ?", email, true])
|
||||
if User.exists?(email: email.downcase, registered: true)
|
||||
flash[:error] = "Invitation was not sent. There is already a registered user with the email: #{email}"
|
||||
redirect_to admin_invitations_path
|
||||
return
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ class BufferUpdatesController < ApplicationController
|
|||
create_main_tweet
|
||||
create_satellite_tweets
|
||||
create_facebook_post
|
||||
@article.update(last_buffered: Time.current)
|
||||
redirect_back(fallback_location: "/mod")
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue