-
Notifications
You must be signed in to change notification settings - Fork 372
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
Add / modify user by template #692
base: dev
Are you sure you want to change the base?
Conversation
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 don't think this be approved because templates are useful when they come to dashboard, changes like this is good for when we can set different access for each admin
app/utils/share.py
Outdated
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.
share.py its a file for making configs for users not creating new user
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.
don't want to make routers too long
and i don't creat a user just create object
app/models/user.py
Outdated
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.
you can add property here and make user in here at CreateUserFromTemplate class
app/views/user.py
Outdated
|
||
|
||
@app.post("/api/user", tags=['User'], response_model=UserResponse) | ||
def add_user(new_user: UserCreate, | ||
def add_user(new_user: UserCreate | CreateUserFromTemplate, |
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.
its better to separate api requests
@@ -44,6 +44,7 @@ PyMySQL==1.0.3 | |||
pyOpenSSL==23.2.0 | |||
pyparsing==3.0.9 | |||
pypng==0.20220715.0 | |||
PySocks==1.7.1 |
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 can't find where you use this new library
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 try to access telegram use socks and that needed this lib so i added
It's good PR, some users ask about this 👍 |
now we can add or modify user by templates using
POST /api/user/from_template
andPUT /api/user/{username}