diff --git a/src/repository/migrations/0044_alter_repositoryfield_help_text.py b/src/repository/migrations/0044_alter_repositoryfield_help_text.py new file mode 100644 index 000000000..dabd63c57 --- /dev/null +++ b/src/repository/migrations/0044_alter_repositoryfield_help_text.py @@ -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, + ) + ] diff --git a/src/repository/models.py b/src/repository/models.py index 0cff19546..c596c47f0 100755 --- a/src/repository/models.py +++ b/src/repository/models.py @@ -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',