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

feat: simplified user administration #20

Open
wants to merge 14 commits into
base: sqlite
Choose a base branch
from

Conversation

NanamiNakano
Copy link
Collaborator

No description provided.

@forrestbao
Copy link
Member

Can we make user administration as simple as below?

  1. Add a dummy, empty CSV file with the correct columns.
  2. To add, delete, or update users, just edit the CSV file.
  3. When done, use one command to convert CSV to SQLite file.

The script for user administration shall be called use_admin.py It shall have to subcommands: csv2sqlite and sqlite2csv.

Tell the admin to put the CSV file in a safe place.

@NanamiNakano
Copy link
Collaborator Author

I think I've simplified this far, except for not renaming the file. I added the documentation for the new script in the Readme. Or am I not understanding what you are saying?

@forrestbao
Copy link
Member

For all actions other than creating a new user, there should be a one-to-one correspondence between the CSV and the SQLite DB. Thus, the content in CSV shall be the same as the content in the SQLite DB.

As an example, to delete a user, simply remove the row in the CSV file corresponding to that row and import (called "apply" here) to the SQLite folder.

Let me work on user admin. I feel mixing command line options and CSV file makes it complicated.

@forrestbao
Copy link
Member

@NanamiNakano I have refactored the code to avoid using the CSV as an importing source. The user admin script has been renamed from user_utils.py to user_admin.py. Please see user_admin.md for the usage and test all options, and fix bugs if needed.

At one place, I used an ugly implementation. Please find it by searching FIXME and fix it.

Third, to avoid confusions, we shall rename user_name to name. Please make the change throughout the codebase and docs.

When done, please submit a review.

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

Successfully merging this pull request may close these issues.

2 participants