Skip to content

Commit 51ef299

Browse files
Change conference name from multi-lingual field to CharField
- Convert Conference.name from I18nCharField to models.CharField - Remove unused I18nCharField import from conference model - Create migration 0055 to handle database schema change - Update GraphQL Conference type to use regular field instead of localized resolver Fixes #4066 Co-authored-by: Marco Acierno <[email protected]>
1 parent f8a87d3 commit 51ef299

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

backend/api/conferences/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def from_django_model(cls, instance, info):
149149
class Conference:
150150
id: strawberry.ID
151151

152-
name: str = strawberry.field(resolver=make_localized_resolver("name"))
152+
name: str
153153
introduction: str = strawberry.field(
154154
resolver=make_localized_resolver("introduction")
155155
)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated manually to change conference name from I18nCharField to CharField
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('conferences', '0054_conference_frontend_revalidate_secret_and_more'),
10+
]
11+
12+
operations = [
13+
migrations.AlterField(
14+
model_name='conference',
15+
name='name',
16+
field=models.CharField(max_length=100, verbose_name='name'),
17+
),
18+
]

backend/conferences/models/conference.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from timezone_field import TimeZoneField
77

88
from helpers.models import GeoLocalizedModel
9-
from i18n.fields import I18nCharField, I18nTextField
9+
from i18n.fields import I18nTextField
1010

1111
from .deadline import Deadline, DeadlineStatus
1212

@@ -24,7 +24,7 @@ class Conference(GeoLocalizedModel, TimeFramedModel, TimeStampedModel):
2424
null=True,
2525
)
2626

27-
name = I18nCharField(_("name"), max_length=100)
27+
name = models.CharField(_("name"), max_length=100)
2828
code = models.CharField(_("code"), max_length=100, unique=True)
2929
timezone = TimeZoneField()
3030
logo = models.ImageField(_("logo"), upload_to=get_upload_to, blank=True)

0 commit comments

Comments
 (0)