-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#4296 switches RepositoryField.help_text back to a TextField
- Loading branch information
Showing
2 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
src/repository/migrations/0044_alter_repositoryfield_help_text.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
) | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters