From 539f010bd53da8fbb1d587ee8c03a840fdaaa75b Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Mon, 8 Jul 2024 20:37:35 +0200 Subject: [PATCH] Gold: update `max_length` to accept Stripe price `id` (#11452) Solves https://read-the-docs.sentry.io/issues/5542852208/ --- .../migrations/0007_gold_level_varchar.py | 31 +++++++++++++++++++ readthedocs/gold/models.py | 2 +- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 readthedocs/gold/migrations/0007_gold_level_varchar.py diff --git a/readthedocs/gold/migrations/0007_gold_level_varchar.py b/readthedocs/gold/migrations/0007_gold_level_varchar.py new file mode 100644 index 00000000000..4980ddbe07a --- /dev/null +++ b/readthedocs/gold/migrations/0007_gold_level_varchar.py @@ -0,0 +1,31 @@ +# Generated by Django 4.2.13 on 2024-07-08 09:06 + +from django.db import migrations, models +from django_safemigrate import Safe + + +class Migration(migrations.Migration): + safe = Safe.before_deploy + dependencies = [ + ("gold", "0006_remove_old_payments_field"), + ] + + operations = [ + migrations.AlterField( + model_name="golduser", + name="level", + field=models.CharField( + choices=[ + ("v1-org-5", "$5/mo"), + ("v1-org-10", "$10/mo"), + ("v1-org-15", "$15/mo"), + ("v1-org-20", "$20/mo"), + ("v1-org-50", "$50/mo"), + ("v1-org-100", "$100/mo"), + ], + default="v1-org-5", + max_length=64, + verbose_name="Level", + ), + ), + ] diff --git a/readthedocs/gold/models.py b/readthedocs/gold/models.py index 1ff7c32744b..a6ce8f45b6a 100644 --- a/readthedocs/gold/models.py +++ b/readthedocs/gold/models.py @@ -37,7 +37,7 @@ class GoldUser(models.Model): ) level = models.CharField( _("Level"), - max_length=20, + max_length=64, choices=LEVEL_CHOICES, default=LEVEL_CHOICES[0][0], )