Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

acidjunk
Copy link
Owner

No description provided.

Copy link
Owner Author

@acidjunk acidjunk left a 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.

@@ -32,7 +32,7 @@
@api.route("/")
@api.doc("Show all users to staff users.")
class UserResourceList(Resource):
@roles_accepted("admin")
# @roles_accepted("admin")
Copy link
Owner Author

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):
Copy link
Owner Author

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)

Copy link
Collaborator

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

@@ -216,6 +220,14 @@ def post(self):
save(order)
return order, 201

@api.route('/iptest')
Copy link
Owner Author

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
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably clicked backspace

@@ -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,
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks weird

Copy link
Collaborator

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
Copy link
Owner Author

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.

Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants