do not pass in the diaspora handle query as a regex, we want to search on the string literal. also use dynamic finder
This commit is contained in:
parent
637d35d673
commit
bcec2d04e6
1 changed files with 2 additions and 2 deletions
|
|
@ -97,8 +97,8 @@ class Person
|
||||||
# Raise an error if identifier is not a valid email (generous regexp)
|
# Raise an error if identifier is not a valid email (generous regexp)
|
||||||
raise "Identifier is invalid" if !(identifier =~ /\A.*\@.*\..*\Z/)
|
raise "Identifier is invalid" if !(identifier =~ /\A.*\@.*\..*\Z/)
|
||||||
|
|
||||||
query = /#{Regexp.escape(identifier.gsub('acct:', '').to_s)}/i
|
query = identifier.gsub('acct:', '').to_s
|
||||||
local_person = Person.first(:diaspora_handle => query)
|
local_person = Person.find_by_diaspora_handle(:diaspora_handle => query)
|
||||||
|
|
||||||
if local_person
|
if local_person
|
||||||
Rails.logger.info("Do not need to webfinger, found a local person #{local_person.real_name}")
|
Rails.logger.info("Do not need to webfinger, found a local person #{local_person.real_name}")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue