Skip to content
This repository has been archived by the owner on Jan 21, 2021. It is now read-only.

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
Release v2.2.1
  • Loading branch information
alirzaev committed Feb 10, 2019
2 parents c57a75b + 5e597c3 commit 040e8be
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion models/logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
_collection = get_collection('logs')


def insert_one(req_path: str):
def insert_one(req_path: str, useragent: str):
_collection.insert_one({
'path': req_path,
'useragent': useragent,
'date': datetime.now()
})
2 changes: 1 addition & 1 deletion server.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
@api_v1_blueprint.before_request
@api_v2_blueprint.before_request
def logs_to_mongo(): # logs each request into MongoDB
logs.insert_one(request.full_path)
logs.insert_one(request.full_path, request.user_agent.string)


app.register_blueprint(api_v1_blueprint, url_prefix='/api/v1')
Expand Down

0 comments on commit 040e8be

Please sign in to comment.