Reformat libraries
This commit is contained in:
parent
dabe3eca7b
commit
63df8f9ce7
|
@ -1,24 +1,15 @@
|
|||
import pprint
|
||||
from datetime import datetime
|
||||
|
||||
import stripe
|
||||
from chartjs.views.lines import BaseLineChartView
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||
from django.http import HttpResponse, JsonResponse
|
||||
from django.shortcuts import redirect, render
|
||||
from django.urls import reverse, reverse_lazy
|
||||
from django.utils.decorators import method_decorator
|
||||
from django.views import View
|
||||
from django.views.decorators.csrf import csrf_exempt
|
||||
from django.views.generic.edit import CreateView
|
||||
from rest_framework.parsers import JSONParser
|
||||
from rest_framework.views import APIView
|
||||
|
||||
from core.forms import NewUserForm
|
||||
from core.lib.products import assemble_plan_map
|
||||
from core.models import Plan, Session, User
|
||||
|
||||
|
||||
class Callback(APIView):
|
||||
parser_classes = [JSONParser]
|
||||
|
||||
|
@ -38,7 +29,6 @@ class Callback(APIView):
|
|||
# Invalid signature
|
||||
return HttpResponse(status=400)
|
||||
|
||||
pp.pprint(request.data)
|
||||
if request.data is None:
|
||||
return JsonResponse({"success": False}, status=500)
|
||||
if "type" in request.data.keys():
|
||||
|
@ -109,4 +99,4 @@ class Callback(APIView):
|
|||
user.save()
|
||||
else:
|
||||
return JsonResponse({"success": False}, status=500)
|
||||
return JsonResponse({"success": True})
|
||||
return JsonResponse({"success": True})
|
||||
|
|
|
@ -1,23 +1,8 @@
|
|||
import pprint
|
||||
from datetime import datetime
|
||||
|
||||
import stripe
|
||||
from chartjs.views.lines import BaseLineChartView
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||
from django.http import HttpResponse, JsonResponse
|
||||
from django.shortcuts import redirect, render
|
||||
from django.urls import reverse, reverse_lazy
|
||||
from django.utils.decorators import method_decorator
|
||||
from django.views import View
|
||||
from django.views.decorators.csrf import csrf_exempt
|
||||
from django.views.generic.edit import CreateView
|
||||
from rest_framework.parsers import JSONParser
|
||||
from rest_framework.views import APIView
|
||||
|
||||
from core.forms import NewUserForm
|
||||
from core.lib.products import assemble_plan_map
|
||||
from core.models import Plan, Session, User
|
||||
|
||||
class CSRFExemptMixin(object):
|
||||
@method_decorator(csrf_exempt)
|
||||
|
|
Loading…
Reference in New Issue