cleanup
This commit is contained in:
@ -1,16 +1,9 @@
|
||||
from .authclient import AuthClient, AUTH_HEADERS
|
||||
from .autherror import AuthError
|
||||
from .authclient import AuthClient, AuthError, AUTH_HEADERS
|
||||
from .utils import post_request, get_request
|
||||
|
||||
|
||||
class SciCat(AuthClient):
|
||||
|
||||
@property
|
||||
def proposals(self):
|
||||
url = self.address + "/proposals"
|
||||
headers = self.auth_headers
|
||||
return get_request(url, headers=headers)
|
||||
|
||||
def authenticate(self, username, password):
|
||||
url = self.address + "/users/login"
|
||||
auth_payload = {
|
||||
@ -26,6 +19,13 @@ class SciCat(AuthClient):
|
||||
return token
|
||||
|
||||
|
||||
@property
|
||||
def proposals(self):
|
||||
url = self.address + "/proposals"
|
||||
headers = self.auth_headers
|
||||
return get_request(url, headers=headers)
|
||||
|
||||
|
||||
|
||||
class SciCatAuthError(AuthError):
|
||||
pass
|
||||
|
Reference in New Issue
Block a user