Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
webomagic-auth
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Pratik Shrivastava
webomagic-auth
Commits
21bd3318
Commit
21bd3318
authored
Jul 23, 2024
by
Pratik Shrivastava
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add update password method
parent
d93b5e06
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
app/routes/user/user_dao_service.py
app/routes/user/user_dao_service.py
+15
-0
No files found.
app/routes/user/user_dao_service.py
View file @
21bd3318
...
@@ -183,3 +183,18 @@ def add_new_user(user_info: dict, admin_id: int) -> int:
...
@@ -183,3 +183,18 @@ def add_new_user(user_info: dict, admin_id: int) -> int:
db
.
session
.
add
(
new_user
)
db
.
session
.
add
(
new_user
)
db
.
session
.
commit
()
db
.
session
.
commit
()
return
new_user
.
id
return
new_user
.
id
def
update_password
(
user_id
:
int
,
new_password
:
str
)
->
bool
|
None
:
try
:
user_info
:
ORM
.
User
=
get_user_by_id
(
user_id
)
user_info
.
password
=
new_password
db
.
session
.
commit
()
return
True
except
Exception
as
e
:
db
.
session
.
rollback
()
raise
e
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment