diff --git a/core/factory_apps/location.py b/core/factory_apps/location.py index 244dcede..690221a1 100644 --- a/core/factory_apps/location.py +++ b/core/factory_apps/location.py @@ -109,7 +109,7 @@ def add_backing(self, create, extracted, **kwargs): @factory.post_generation def add_stuff(self, create, extracted, **kwargs): # avoid recursive import - from . import events, payment + from . import events LocationFeeFactory(location=self) diff --git a/core/factory_apps/payment.py b/core/factory_apps/payment.py index 7fbe3ba0..d1654bb0 100644 --- a/core/factory_apps/payment.py +++ b/core/factory_apps/payment.py @@ -8,7 +8,6 @@ from .user import UserFactory - class BillFactory(DjangoModelFactory): """Bookings or BillLineItem""" diff --git a/core/migrations/0006_remove_backing_subscription_and_more.py b/core/migrations/0006_remove_backing_subscription_and_more.py new file mode 100644 index 00000000..5bbb2eb5 --- /dev/null +++ b/core/migrations/0006_remove_backing_subscription_and_more.py @@ -0,0 +1,62 @@ +# Generated by Django 5.0.7 on 2024-09-21 19:26 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("core", "0005_membership"), + ] + + operations = [ + migrations.RemoveField( + model_name="backing", + name="subscription", + ), + migrations.RemoveField( + model_name="subscriptionbill", + name="subscription", + ), + migrations.RemoveField( + model_name="subscriptionnote", + name="subscription", + ), + migrations.RemoveField( + model_name="subscriptionbill", + name="bill_ptr", + ), + migrations.RemoveField( + model_name="subscriptionnote", + name="created_by", + ), + migrations.AlterField( + model_name="emailtemplate", + name="context", + field=models.CharField(choices=[("booking", "Booking")], max_length=32), + ), + migrations.AlterField( + model_name="locationemailtemplate", + name="key", + field=models.CharField( + choices=[ + ("admin_daily_update", "Admin Daily Update"), + ("guest_daily_update", "Guest Daily Update"), + ("invoice", "Invoice"), + ("receipt", "Booking Receipt"), + ("newbooking", "New Booking"), + ("pre_arrival_welcome", "Pre-Arrival Welcome"), + ("departure", "Departure"), + ], + max_length=32, + ), + ), + migrations.DeleteModel( + name="Subscription", + ), + migrations.DeleteModel( + name="SubscriptionBill", + ), + migrations.DeleteModel( + name="SubscriptionNote", + ), + ] diff --git a/core/models.py b/core/models.py index 208096ba..6152a008 100644 --- a/core/models.py +++ b/core/models.py @@ -2,11 +2,9 @@ import logging import os import uuid -from datetime import date, timedelta from decimal import Decimal import django.dispatch -from dateutil.relativedelta import relativedelta from django.conf import settings from django.contrib.auth.models import User from django.contrib.flatpages.models import FlatPage diff --git a/core/views/billing.py b/core/views/billing.py index 54bea785..0eee4de5 100644 --- a/core/views/billing.py +++ b/core/views/billing.py @@ -9,7 +9,6 @@ from django.contrib import messages from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User -from django.contrib.sites.models import Site from django.db.models import Q from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404, redirect, render @@ -29,11 +28,9 @@ Bill, BillLineItem, Booking, - EmailTemplate, Location, LocationFee, Payment, - UserNote, ) from core.tasks import guest_welcome from core.views import occupancy @@ -294,7 +291,9 @@ def BillCharge(request, location_slug, bill_id): "Cannot charge more than remaining amount owed ($%d was requested on $%d owed)" % (charge_amount_dollars, bill.total_owed()), ) - raise Exception("bill charge error: cannot charge more than remaining amount owed") + raise Exception( + "bill charge error: cannot charge more than remaining amount owed" + ) if bill.is_booking_bill(): user = bill.bookingbill.booking.user diff --git a/requirements-dev.txt b/requirements-dev.txt index ce9e5afc..0f774019 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1 +1 @@ -ruff==0.6.5 +ruff==0.6.7