Uploads: Check if strategy is enabled before use
Avoid returning bare API tracebacks from pixiv et al when login details are not configured, and instead raise a generic error.
This commit is contained in:
@@ -24,6 +24,10 @@ module Sources::Strategies
|
||||
STATUS1 = %r{\A#{HOST}/web/statuses/(?<status_id>\d+)}
|
||||
STATUS2 = %r{\A#{NAMED_PROFILE}/(?<status_id>\d+)}
|
||||
|
||||
def self.enabled?
|
||||
Danbooru.config.pawoo_client_id.present? && Danbooru.config.pawoo_client_secret.present?
|
||||
end
|
||||
|
||||
def domains
|
||||
["pawoo.net"]
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user