Skip to content
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

Password check needs to happen in three places #30

Open
tashrifbillah opened this issue Dec 18, 2022 · 1 comment
Open

Password check needs to happen in three places #30

tashrifbillah opened this issue Dec 18, 2022 · 1 comment
Labels

Comments

@tashrifbillah
Copy link
Contributor

  • To print incorrect password error
  • To render execute table
  • To save data

So need to modularize it instead of duplicating code.

@tashrifbillah
Copy link
Contributor Author

Password checking is different in three blocks:

  • To print incorrect password error

    eeg-qc-dash/app.py

    Lines 211 to 228 in ed1242b

    if site and passwd:
    if passwd==_passwd.loc['dpacc','passwd']:
    pass
    elif passwd==_passwd.loc[site,'passwd']:
    pass
    else:
    # return f'Invalid password for site {site}, try again'
    return True
    elif not site and passwd:
    if passwd==_passwd.loc['dpacc','passwd']:
    pass
    else:
    # return f'Invalid password for site {site}, try again'
    return True
    else:
    raise PreventUpdate

  • To render execute table

    eeg-qc-dash/app.py

    Lines 275 to 281 in ed1242b

    # verify password
    if passwd==_passwd.loc['dpacc','passwd']:
    pass
    elif passwd==_passwd.loc[site,'passwd']:
    pass
    else:
    raise PreventUpdate

  • To save data

    if passwd==_passwd.loc['dpacc','passwd']:

So keeping it simple and un-modular.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant