diff options
Diffstat (limited to 'alphabetlearning')
-rw-r--r-- | alphabetlearning/payments/views.py | 28 | ||||
-rw-r--r-- | alphabetlearning/resources/factories.py | 2 | ||||
-rw-r--r-- | alphabetlearning/resources/migrations/0003_remove_resource_price.py | 17 | ||||
-rw-r--r-- | alphabetlearning/resources/models.py | 14 |
4 files changed, 34 insertions, 27 deletions
diff --git a/alphabetlearning/payments/views.py b/alphabetlearning/payments/views.py index 6eaae1a..cdfafe6 100644 --- a/alphabetlearning/payments/views.py +++ b/alphabetlearning/payments/views.py @@ -1,29 +1,19 @@ import stripe +from alphabetlearning.payments.models import EmailSignup, EmailVerification +from alphabetlearning.resources.models import Resource +from alphabetlearning.users.models import User from django.conf import settings from django.contrib.auth.decorators import login_required -from django.core.mail import mail_admins -from django.core.mail import send_mail -from django.http import HttpResponse -from django.http import HttpResponseBadRequest -from django.shortcuts import get_object_or_404 -from django.shortcuts import redirect -from django.shortcuts import render -from django.urls import reverse -from django.urls import reverse_lazy +from django.core.mail import mail_admins, send_mail +from django.http import HttpResponse, HttpResponseBadRequest +from django.shortcuts import get_object_or_404, redirect, render +from django.urls import reverse, reverse_lazy from django.views import View from django.views.decorators.csrf import csrf_exempt -from django.views.generic import DeleteView -from django.views.generic import TemplateView - -from alphabetlearning.payments.models import EmailSignup -from alphabetlearning.payments.models import EmailVerification -from alphabetlearning.resources.models import Resource -from alphabetlearning.users.models import User +from django.views.generic import DeleteView, TemplateView from .forms import EmailVerificationForm -from .models import CartItem -from .models import Price -from .models import ShoppingCart +from .models import CartItem, Price, ShoppingCart # TODO get the cart integrated with Stripe # Steps to convert our Cart into something that can be used with Stripe: diff --git a/alphabetlearning/resources/factories.py b/alphabetlearning/resources/factories.py index e15a105..47d86e2 100644 --- a/alphabetlearning/resources/factories.py +++ b/alphabetlearning/resources/factories.py @@ -36,7 +36,7 @@ class ResourceModelFactory(factory.django.DjangoModelFactory): model = Resource name = factory.Sequence(lambda n: f"Default Resource {n}") - price = factory.Faker("pydecimal", left_digits=4, right_digits=2, positive=True) + # price = factory.Faker("pydecimal", left_digits=4, right_digits=2, positive=True) thumbnail_filenames = factory.List( [factory.Faker("file_name", extension="jpg") for _ in range(3)] ) diff --git a/alphabetlearning/resources/migrations/0003_remove_resource_price.py b/alphabetlearning/resources/migrations/0003_remove_resource_price.py new file mode 100644 index 0000000..3bcd707 --- /dev/null +++ b/alphabetlearning/resources/migrations/0003_remove_resource_price.py @@ -0,0 +1,17 @@ +# Generated by Django 5.1.4 on 2025-01-06 19:40 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('resources', '0002_resource_price'), + ] + + operations = [ + migrations.RemoveField( + model_name='resource', + name='price', + ), + ] diff --git a/alphabetlearning/resources/models.py b/alphabetlearning/resources/models.py index f5c3223..3f4ee8c 100644 --- a/alphabetlearning/resources/models.py +++ b/alphabetlearning/resources/models.py @@ -38,13 +38,13 @@ DESC_HELP_TEXT = """ class Resource(models.Model): name = models.CharField(max_length=255, null=False) stripe_product_id = models.CharField(max_length=100) - price = models.DecimalField( - max_digits=6, - decimal_places=2, - default=0.00, - null=False, - blank=False, - ) + # price = models.DecimalField( + # max_digits=6, + # decimal_places=2, + # default=0.00, + # null=False, + # blank=False, + # ) thumbnail_filenames = models.JSONField( null=False, verbose_name="Thumbnail filenames", |