Skip to content
Snippets Groups Projects
Commit a20cf3b6 authored by unarist's avatar unarist Committed by Eugen Rochko
Browse files

Fix RemoteFollow behavior (#3868)

* Invalid acct is an error. not "2 errors".
* Empty input should be different error from invalid acct
parent 356df7ae
No related branches found
No related tags found
No related merge requests found
......@@ -5,11 +5,15 @@ class RemoteFollow
attr_accessor :acct, :addressable_template
validates :acct, presence: true
def initialize(attrs = {})
@acct = attrs[:acct].gsub(/\A@/, '').strip unless attrs[:acct].nil?
end
def valid?
return false unless super
populate_template
errors.empty?
end
......@@ -39,7 +43,6 @@ class RemoteFollow
def acct_resource
@_acct_resource ||= Goldfinger.finger("acct:#{acct}")
rescue Goldfinger::Error
missing_resource_error
nil
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment