Skip to content

Commit

Permalink
#4296 switches RepositoryField.help_text back to a TextField
Browse files Browse the repository at this point in the history
  • Loading branch information
ajrbyers committed Jun 26, 2024
1 parent 9daf7f8 commit 9221aca
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
31 changes: 31 additions & 0 deletions src/repository/migrations/0044_alter_repositoryfield_help_text.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Generated by Django 4.2 on 2024-06-26 10:12

from django.db import migrations, models
from django.template.defaultfilters import striptags


def strip_html_tags_from_repo_field_help_text(apps, schema_editor):
RepositoryField = apps.get_model('repository', 'RepositoryField')

for field in RepositoryField.objects.all():
field.help_text = striptags(field.help_text)
field.save()


class Migration(migrations.Migration):

dependencies = [
('repository', '0043_auto_20240402_1256'),
]

operations = [
migrations.AlterField(
model_name='repositoryfield',
name='help_text',
field=models.TextField(blank=True, null=True),
),
migrations.RunPython(
strip_html_tags_from_repo_field_help_text,
reverse_code=migrations.RunPython.noop,
)
]
5 changes: 4 additions & 1 deletion src/repository/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,10 @@ class RepositoryField(models.Model):
)
required = models.BooleanField(default=True)
order = models.IntegerField()
help_text = model_utils.JanewayBleachField(blank=True, null=True)
help_text = models.TextField(
blank=True,
null=True,
)
display = models.BooleanField(
default=False,
help_text='Whether or not display this field in the article page',
Expand Down

0 comments on commit 9221aca

Please sign in to comment.