Browser tries to login if the password is not None
Workaround since there is no way yet to mark a config argument as optional.
This commit is contained in:
parent
f11d093e22
commit
5fcc515fa6
1 changed files with 5 additions and 2 deletions
|
|
@ -43,7 +43,7 @@ class PastebinBackend(BaseBackend, BasePasteBackend):
|
||||||
CONFIG = ValuesDict(
|
CONFIG = ValuesDict(
|
||||||
Value('username', label='Optional username', default=''),
|
Value('username', label='Optional username', default=''),
|
||||||
Value('password', label='Optional password', default='', masked=True),
|
Value('password', label='Optional password', default='', masked=True),
|
||||||
Value('api_key', label='Optional API key', default='', masked=True),
|
Value('api_key', label='Optional API key', default='', masked=True),
|
||||||
)
|
)
|
||||||
|
|
||||||
EXPIRATIONS = {
|
EXPIRATIONS = {
|
||||||
|
|
@ -55,7 +55,10 @@ class PastebinBackend(BaseBackend, BasePasteBackend):
|
||||||
}
|
}
|
||||||
|
|
||||||
def create_default_browser(self):
|
def create_default_browser(self):
|
||||||
return self.create_browser(self.config['api_key'], self.config['username'], self.config['password'], get_home=False)
|
return self.create_browser(self.config['api_key'] if self.config['api_key'] else None,
|
||||||
|
self.config['username'] if self.config['username'] else None,
|
||||||
|
self.config['password'] if self.config['password'] else None,
|
||||||
|
get_home=False)
|
||||||
|
|
||||||
def new_paste(self, *args, **kwargs):
|
def new_paste(self, *args, **kwargs):
|
||||||
return PastebinPaste(*args, **kwargs)
|
return PastebinPaste(*args, **kwargs)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue