Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Make the license author non-nullable

Roland Geider993ab6af8fd2
diff --git a/wger/exercises/migrations/0040_alter_exercise_license_author_and_more.py b/wger/exercises/migrations/0040_alter_exercise_license_author_and_more.py
new file mode 100644
index 000000000..1795bfbdc
--- /dev/null
+++ b/wger/exercises/migrations/0040_alter_exercise_license_author_and_more.py
@@ -0,0 +1,100 @@
+# Generated by Django 5.2.12 on 2026-05-11 14:50
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ('exercises', '0039_translation_alias_trigram_gin_index'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='exercise',
+ name='license_author',
+ field=models.TextField(
+ blank=True,
+ default='',
+ help_text='If you are not the author, enter the name or source here.',
+ max_length=3500,
+ verbose_name='Author(s)',
+ ),
+ ),
+ migrations.AlterField(
+ model_name='exerciseimage',
+ name='license_author',
+ field=models.TextField(
+ blank=True,
+ default='',
+ help_text='If you are not the author, enter the name or source here.',
+ max_length=3500,
+ verbose_name='Author(s)',
+ ),
+ ),
+ migrations.AlterField(
+ model_name='exercisevideo',
+ name='license_author',
+ field=models.TextField(
+ blank=True,
+ default='',
+ help_text='If you are not the author, enter the name or source here.',
+ max_length=3500,
+ verbose_name='Author(s)',
+ ),
+ ),
+ migrations.AlterField(
+ model_name='historicalexercise',
+ name='license_author',
+ field=models.TextField(
+ blank=True,
+ default='',
+ help_text='If you are not the author, enter the name or source here.',
+ max_length=3500,
+ verbose_name='Author(s)',
+ ),
+ ),
+ migrations.AlterField(
+ model_name='historicalexerciseimage',
+ name='license_author',
+ field=models.TextField(
+ blank=True,
+ default='',
+ help_text='If you are not the author, enter the name or source here.',
+ max_length=3500,
+ verbose_name='Author(s)',
+ ),
+ ),
+ migrations.AlterField(
+ model_name='historicalexercisevideo',
+ name='license_author',
+ field=models.TextField(
+ blank=True,
+ default='',
+ help_text='If you are not the author, enter the name or source here.',
+ max_length=3500,
+ verbose_name='Author(s)',
+ ),
+ ),
+ migrations.AlterField(
+ model_name='historicaltranslation',
+ name='license_author',
+ field=models.TextField(
+ blank=True,
+ default='',
+ help_text='If you are not the author, enter the name or source here.',
+ max_length=3500,
+ verbose_name='Author(s)',
+ ),
+ ),
+ migrations.AlterField(
+ model_name='translation',
+ name='license_author',
+ field=models.TextField(
+ blank=True,
+ default='',
+ help_text='If you are not the author, enter the name or source here.',
+ max_length=3500,
+ verbose_name='Author(s)',
+ ),
+ ),
+ ]
diff --git a/wger/nutrition/migrations/0036_alter_image_license_author_and_more.py b/wger/nutrition/migrations/0036_alter_image_license_author_and_more.py
new file mode 100644
index 000000000..36c873ee4
--- /dev/null
+++ b/wger/nutrition/migrations/0036_alter_image_license_author_and_more.py
@@ -0,0 +1,34 @@
+# Generated by Django 5.2.12 on 2026-05-11 14:50
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ('nutrition', '0035_add_uuids'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='image',
+ name='license_author',
+ field=models.TextField(
+ blank=True,
+ default='',
+ help_text='If you are not the author, enter the name or source here.',
+ max_length=3500,
+ verbose_name='Author(s)',
+ ),
+ ),
+ migrations.AlterField(
+ model_name='ingredient',
+ name='license_author',
+ field=models.TextField(
+ blank=True,
+ default='',
+ help_text='If you are not the author, enter the name or source here.',
+ max_length=3500,
+ verbose_name='Author(s)',
+ ),
+ ),
+ ]
diff --git a/wger/utils/models.py b/wger/utils/models.py
index d2152cebc..c5fc41fb7 100644
--- a/wger/utils/models.py
+++ b/wger/utils/models.py
@@ -67,7 +67,7 @@ class AbstractLicenseModel(models.Model):
verbose_name=_('Author(s)'),
max_length=3500,
blank=True,
- null=True,
+ default='',
help_text=_('If you are not the author, enter the name or source here.'),
)