Skip to content
Snippets Groups Projects
Commit e2408349 authored by Christian Dresen's avatar Christian Dresen
Browse files

[WarpPay] Enabled Authentification

parent cab1c5cb
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,7 @@ urlpatterns = [
url(r'^api/users/(?P<user_id>\w+)/$', views.user_list),
url(r'^api/products/$', views.product_list),
url(r'^api/categories/$', views.category_list),
url(r'^api/gen_token/$', views.gen_token),
# url(r'^api/gen_token/$', views.gen_token),
url(r'^api/transaction/(?P<user_id>\w+)/$', views.transaction),
url(r'^api/products/(?P<prod_id>\w+)/barcode/$', views.addBarcode),
......
......@@ -13,9 +13,9 @@ from rest_framework import status
# logging.getLogger('main').info(token.key)
@api_view(['GET', 'PUT'])
#@authentication_classes((TokenAuthentication,))
#@permission_classes((IsAuthenticated,))
@api_view(['GET'])
@authentication_classes((TokenAuthentication,))
@permission_classes((IsAuthenticated,))
def category_list(request):
if request.method == 'GET':
products = ProductCategory.objects.all()
......@@ -26,8 +26,8 @@ def category_list(request):
@api_view(['GET', 'PUT'])
#@authentication_classes((TokenAuthentication,))
#@permission_classes((IsAuthenticated,))
@authentication_classes((TokenAuthentication,))
@permission_classes((IsAuthenticated,))
def product_list(request):
if request.method == 'GET':
products = Product.objects.all()
......@@ -62,8 +62,8 @@ def gen_token(request):
return Response()
@api_view(['GET', 'PUT'])
#@authentication_classes((TokenAuthentication,))
#@permission_classes((IsAuthenticated,))
@authentication_classes((TokenAuthentication,))
@permission_classes((IsAuthenticated,))
def user_list(request, user_id = 0):
if request.method == 'GET':
sync_users()
......@@ -117,8 +117,8 @@ def user_list(request, user_id = 0):
@api_view(['PUT'])
#@authentication_classes((TokenAuthentication,))
#@permission_classes((IsAuthenticated,))
@authentication_classes((TokenAuthentication,))
@permission_classes((IsAuthenticated,))
def transaction(request, user_id=None):
if request.method == 'PUT':
if 'trans_type' not in request.data or not user_id:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment