Reformat libraries

This commit is contained in:
Mark Veidemanis 2022-07-21 13:50:04 +01:00
parent dabe3eca7b
commit 63df8f9ce7
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
2 changed files with 2 additions and 27 deletions

View File

@ -1,24 +1,15 @@
import pprint
from datetime import datetime from datetime import datetime
import stripe import stripe
from chartjs.views.lines import BaseLineChartView
from django.conf import settings from django.conf import settings
from django.contrib.auth.mixins import LoginRequiredMixin
from django.http import HttpResponse, JsonResponse 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.decorators.csrf import csrf_exempt
from django.views.generic.edit import CreateView
from rest_framework.parsers import JSONParser from rest_framework.parsers import JSONParser
from rest_framework.views import APIView 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 from core.models import Plan, Session, User
class Callback(APIView): class Callback(APIView):
parser_classes = [JSONParser] parser_classes = [JSONParser]
@ -38,7 +29,6 @@ class Callback(APIView):
# Invalid signature # Invalid signature
return HttpResponse(status=400) return HttpResponse(status=400)
pp.pprint(request.data)
if request.data is None: if request.data is None:
return JsonResponse({"success": False}, status=500) return JsonResponse({"success": False}, status=500)
if "type" in request.data.keys(): if "type" in request.data.keys():
@ -109,4 +99,4 @@ class Callback(APIView):
user.save() user.save()
else: else:
return JsonResponse({"success": False}, status=500) return JsonResponse({"success": False}, status=500)
return JsonResponse({"success": True}) return JsonResponse({"success": True})

View File

@ -1,23 +1,8 @@
import pprint
from datetime import datetime
import stripe
from chartjs.views.lines import BaseLineChartView from chartjs.views.lines import BaseLineChartView
from django.conf import settings
from django.contrib.auth.mixins import LoginRequiredMixin 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.utils.decorators import method_decorator
from django.views import View
from django.views.decorators.csrf import csrf_exempt 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): class CSRFExemptMixin(object):
@method_decorator(csrf_exempt) @method_decorator(csrf_exempt)