Stripe in Blender Studio #93018

Merged
Anna Sirota merged 9 commits from studio-to-stripe into main 2024-06-17 17:39:10 +02:00
Showing only changes of commit 93cbd5ac56 - Show all commits

View File

@ -4,9 +4,6 @@ from django.db import migrations, models
class Migration(migrations.Migration): class Migration(migrations.Migration):
from django.contrib.auth import get_user_model
User = get_user_model()
user_table = User.objects.model._meta.db_table
dependencies = [ dependencies = [
('looper', '0077_revenueperplan'), ('looper', '0077_revenueperplan'),
@ -29,13 +26,6 @@ class Migration(migrations.Migration):
field=models.CharField(blank=True, default='', max_length=255, verbose_name='VAT identification number'), field=models.CharField(blank=True, default='', max_length=255, verbose_name='VAT identification number'),
), ),
migrations.RunSQL('SET CONSTRAINTS ALL IMMEDIATE;'), migrations.RunSQL('SET CONSTRAINTS ALL IMMEDIATE;'),
# Create customer records for each account that doesn't have a customer
migrations.RunSQL(
"insert into looper_customer (user_id, full_name, company, billing_email, tax_exempt, vat_number)"
"select u.id, '', '', '', false, '' "
f"from {user_table} as u left join looper_customer as cu on u.id = cu.user_id "
"where cu.user_id is null",
),
# Create address records for accounts without any # Create address records for accounts without any
migrations.RunSQL( migrations.RunSQL(
"insert into looper_address (category, user_id, full_name, company, country, tax_exempt, vat_number, " "insert into looper_address (category, user_id, full_name, company, country, tax_exempt, vat_number, "