From ef697dfb66b6e11a670c5325eafd1715693ceaba Mon Sep 17 00:00:00 2001 From: Alec Clowes Date: Sat, 28 Jul 2018 18:23:21 -0400 Subject: [PATCH] fix setState to reset page on workflow change (#46) * handle anonymous user toolbar login * bump version --- frontend/src/App.js | 4 +++- frontend/src/WorkflowDetailHistory.js | 25 +++++++++++++++---------- setup.py | 2 +- yawn/settings/debug.py | 5 +++++ 4 files changed, 24 insertions(+), 12 deletions(-) diff --git a/frontend/src/App.js b/frontend/src/App.js index bf0d1ab..fbc4bdc 100644 --- a/frontend/src/App.js +++ b/frontend/src/App.js @@ -63,7 +63,9 @@ export default class App extends React.Component { }; renderToolbar() { - const userAction = this.state.user ? `Logout (${this.state.user.username})` : 'Login'; + const userName = this.state.user && this.state.user.username; + // anonymous user has empty string username, so show Login for them too + const userAction = userName ? `Logout (${userName})` : 'Login'; return (
diff --git a/setup.py b/setup.py index 569070a..30c45fa 100755 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ # Versions should comply with PEP440. For a discussion on single-sourcing # the version across setup.py and the project code, see # https://packaging.python.org/en/latest/single_source_version.html - version='0.2.4', + version='0.2.5', description='Yet Another Workflow Engine, a subprocess-based DAG execution system', long_description=long_description, diff --git a/yawn/settings/debug.py b/yawn/settings/debug.py index 9661214..808aede 100644 --- a/yawn/settings/debug.py +++ b/yawn/settings/debug.py @@ -7,3 +7,8 @@ CSRF_COOKIE_SECURE = False SECURE_PROXY_SSL_HEADER = None SECURE_SSL_REDIRECT = False + +# anonymous read-only allowed +REST_FRAMEWORK['DEFAULT_PERMISSION_CLASSES'] = [ # noqa + 'rest_framework.permissions.IsAuthenticatedOrReadOnly', +]