From 63df8f9ce79cf1c9f6bee8bd370413180f17f3ac Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Thu, 21 Jul 2022 13:50:04 +0100 Subject: [PATCH] Reformat libraries --- core/views/callbacks.py | 14 ++------------ core/views/charts.py | 15 --------------- 2 files changed, 2 insertions(+), 27 deletions(-) diff --git a/core/views/callbacks.py b/core/views/callbacks.py index beeaf65..a09be9c 100644 --- a/core/views/callbacks.py +++ b/core/views/callbacks.py @@ -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}) \ No newline at end of file + return JsonResponse({"success": True}) diff --git a/core/views/charts.py b/core/views/charts.py index 8c3e19a..047c89d 100644 --- a/core/views/charts.py +++ b/core/views/charts.py @@ -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)