-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added shared account selection module based on the old python API #64
Conversation
2904f12
to
523db63
Compare
flow360/error_messages.py
Outdated
shared_submit_warning = """\ | ||
You are submitting a resource from a shared account. | ||
To suppress this message run: flow360 configure --suppress-shared-account-prompt | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the message should read:
You are submitting a resource to a shared account (email address).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 5035ff0 - the message is updated and confirmation now works per-session and needs to be performed only once until the user logs out, either interactively or by the user calling
fl.Accounts.confirm_submit()
flow360/accounts_utils.py
Outdated
|
||
selected = None | ||
|
||
addresses = [d["userEmail"] for d in company_users] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we try to avoid single letter variables, even in such instances. Use user
instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed to user in 644f8ee
flow360/accounts_utils.py
Outdated
user email to impersonate (if email exists among shared accounts), | ||
if email is not provided user can select the account interactively | ||
""" | ||
company_users = self._get_company_users() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets use a list that will have both company users and supported users. Supported in future. Suggest a name shared_accounts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed to shared_accounts in 644f8ee
flow360/component/utils.py
Outdated
@@ -48,6 +50,31 @@ def wrapper_func(*args, **kwargs): | |||
return wrapper | |||
|
|||
|
|||
def confirm_proceed(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename function:
shared_account_confirm_proceed()
or something similar to indicate that this confirmation is only in case of shared account
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed to shared_account_confirm_submit() in 2e584f1
flow360/log.py
Outdated
@@ -289,7 +289,7 @@ def set_logging_file( | |||
filemode: str = "a", | |||
level: LogValue = DEFAULT_LEVEL, | |||
back_up_count: int = 10, | |||
max_bytes: int = 10000, | |||
max_bytes: int = 100000000, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why changing this again? Is it a conflict?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Accidentally changed when running tests to speed up the process before merging with FLPY-35 fix. Reverting in next commit to prevent conflict.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted in 644f8ee
fb447bd
to
2e584f1
Compare
|
||
return self._current_email | ||
|
||
def leave_shared_account(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on leave, we should reset the submit confirm question
2e584f1
to
3441504
Compare
User can now change his account to one of the accounts shared with him (company and clients) while interacting with the backend. This can be done in one of two ways, by calling:
where the account will be switched if the provided email address exists and is shared with the current user or
where the user will be prompted to select an account from the list interactively.
When submitting resources to the server while using a shared account, the user is prompted to confirm the action:
This message shows once per session until the user logs out if the user confirms interactively or by calling
NOTE: Due to backend issues we currently do not support client accounts, as apikey authentication does not seem to work when requesting their data from the webapi. This will be fixed separately.