-
Notifications
You must be signed in to change notification settings - Fork 0
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
IP filter functionality for making orders #19
base: master
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.
@Georgi2704 some comments and if possible I would like to see a unit test also.
server/apis/v1/users.py
Outdated
@@ -32,7 +32,7 @@ | |||
@api.route("/") | |||
@api.doc("Show all users to staff users.") | |||
class UserResourceList(Resource): | |||
@roles_accepted("admin") | |||
# @roles_accepted("admin") |
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.
There are a lot of places now without auth...
server/utils.py
Outdated
|
||
|
||
def is_ip_allowed(request, shops_IP_whitelist, shop_id): | ||
if (shop_id in shops_IP_whitelist): |
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.
more pythonesk to use: shops_IP_whitelist.get(shop_id)
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 ll do that in the next commits
server/apis/v1/orders.py
Outdated
@@ -216,6 +220,14 @@ def post(self): | |||
save(order) | |||
return order, 201 | |||
|
|||
@api.route('/iptest') |
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.
cleanup
|
||
# 5 gram check | ||
# 5 gram checks |
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.
why?
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.
probably clicked backspace
server/apis/v1/orders.py
Outdated
@@ -58,7 +60,7 @@ | |||
"order_info": fields.Nested(order_info_serializer), | |||
# "order_info": fields.String(), | |||
"total": fields.Float(required=True, description="Total"), | |||
"customer_order_id": fields.Integer, | |||
"customer_ord er_id": fields.Integer, |
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.
this looks weird
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.
oops
.idea/.gitignore
Outdated
@@ -0,0 +1,8 @@ | |||
# Default ignored files |
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.
hmm: I normally list the complete ".idea" folder in my root .gitignore
A nice test of your git skills: remove the .idea folder fromthis branch and add the .idea folder to the root ignore file.
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.
ok i will do this
No description provided.