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:
Andy Zhao 2021-02-04 10:00:21 -05:00 committed by GitHub
parent 27f4d238cd
commit 39a63c17f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 2 deletions

View file

@ -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

View file

@ -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