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:
@@ -65,6 +65,10 @@ module Sources
|
||||
STACC_PAGE = %r{\A#{WEB}/stacc/#{MONIKER}/?\z}i
|
||||
NOVEL_PAGE = %r{(?:\Ahttps?://www\.pixiv\.net/novel/show\.php\?id=(\d+))}
|
||||
|
||||
def self.enabled?
|
||||
Danbooru.config.pixiv_login.present? && Danbooru.config.pixiv_password.present?
|
||||
end
|
||||
|
||||
def self.to_dtext(text)
|
||||
if text.nil?
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user