Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2021-090
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2021-090
2021-090
Commits
bf3ec49c
Commit
bf3ec49c
authored
Sep 24, 2021
by
IT18111170-Silva S.H.I
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: user update and delete
parent
0cee0b06
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
11 deletions
+18
-11
Agri_Backend/Agripreneur_App/Auth/Token.py
Agri_Backend/Agripreneur_App/Auth/Token.py
+9
-9
Agri_Backend/Agripreneur_App/Routes/Gamification.py
Agri_Backend/Agripreneur_App/Routes/Gamification.py
+4
-0
Agri_Backend/Agripreneur_App/Routes/User.py
Agri_Backend/Agripreneur_App/Routes/User.py
+5
-2
No files found.
Agri_Backend/Agripreneur_App/Auth/Token.py
View file @
bf3ec49c
...
...
@@ -101,12 +101,12 @@ def login():
)
#logout routes
# @app.route("/logout", methods=["POST"])
# def logout():
# if 'user' in session:
# session.pop('user', None)
# return Response(
# response= json.dumps({"message": "Successfully logout"})
# )
\ No newline at end of file
# logout routes
@
app
.
route
(
"/logout"
,
methods
=
[
"GET"
])
def
logout
():
if
'user'
in
session
:
session
.
pop
(
'user'
,
None
)
return
Response
(
response
=
json
.
dumps
({
"message"
:
"Successfully logout"
})
)
\ No newline at end of file
Agri_Backend/Agripreneur_App/Routes/Gamification.py
View file @
bf3ec49c
...
...
@@ -18,6 +18,10 @@ def add_points_earns(id):
try
:
# points 1-10
# points = 4000
# calculation of earned with area given by user with the selected crop which is given from FE
# area_earn = request.form.get("earns")
earns
=
8000
# points calculation algorithm
if
earns
>=
5000
:
...
...
Agri_Backend/Agripreneur_App/Routes/User.py
View file @
bf3ec49c
...
...
@@ -96,8 +96,11 @@ def update_user(id):
try
:
dbResponse
=
db
.
users
.
update_one
(
{
"_id"
:
ObjectId
(
id
)},
{
"$set"
:
{
"name"
:
request
.
form
[
"name"
]}}
)
{
"$set"
:
{
"name"
:
request
.
form
[
"name"
]}},
upsert
=
True
)
dbResponse
=
db
.
users
.
update_one
(
{
"_id"
:
ObjectId
(
id
)},
{
"$set"
:
{
"district"
:
request
.
form
[
"district"
]}},
upsert
=
True
)
# for attr in dir(dbResponse):
# print(f"{attr}")
...
...
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