Skip to content

Commit

Permalink
#135: Implement refresh session logic for Python ICAT backend
Browse files Browse the repository at this point in the history
  • Loading branch information
MRichards99 committed Jun 25, 2020
1 parent 8ca17eb commit 95bcb7b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 3 additions & 2 deletions common/python_icat_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from common.backend import Backend
from common.helpers import queries_records
from common.python_icat_helpers import requires_session_id, get_session_details_helper, logout_icat_client
from common.python_icat_helpers import requires_session_id, get_session_details_helper, logout_icat_client, refresh_client_session
from common.config import config
from common.exceptions import AuthenticationError
from common.models.db_models import SESSION
Expand Down Expand Up @@ -38,7 +38,8 @@ def get_session_details(self, session_id):

@requires_session_id
def refresh(self, session_id):
pass
self.client.sessionId = session_id
return refresh_client_session(self.client)

@requires_session_id
@queries_records
Expand Down
4 changes: 4 additions & 0 deletions common/python_icat_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,7 @@ def get_session_details_helper(client):

def logout_icat_client(client):
client.logout()


def refresh_client_session(client):
client.refresh()

0 comments on commit 95bcb7b

Please sign in to comment.