From bcb541ba853eabf9836c44ecac96dd5d5ec1618a Mon Sep 17 00:00:00 2001 From: Trent Palmer Date: Sun, 7 Nov 2021 08:19:34 -0800 Subject: [PATCH] add CC BY 4.0 license --- audio/choices.py | 5 +++- audio/migrations/0024_auto_20211107_0710.py | 28 +++++++++++++++++++++ audio/tests/test_licensechoices.py | 5 ++-- 3 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 audio/migrations/0024_auto_20211107_0710.py diff --git a/audio/choices.py b/audio/choices.py index 74ad3a8..5a7d1a4 100644 --- a/audio/choices.py +++ b/audio/choices.py @@ -5,7 +5,8 @@ LICENSE_CHOICES = [ (4, 'CC BY-SA 3.0'), (5, 'CC BY 3.0'), (6, 'CC BY 1.0'), - (7, 'CC0 1.0') + (7, 'CC0 1.0'), + (8, 'CC BY 4.0'), ] @@ -24,3 +25,5 @@ def get_license_info(x): return ('CC BY 1.0', 'https://creativecommons.org/licenses/by/1.0') if x == 7: return ('CC0 1.0', 'https://creativecommons.org/publicdomain/zero/1.0') + if x == 8: + return ('CC BY 4.0', 'https://creativecommons.org/licenses/by/4.0') diff --git a/audio/migrations/0024_auto_20211107_0710.py b/audio/migrations/0024_auto_20211107_0710.py new file mode 100644 index 0000000..8f5eebf --- /dev/null +++ b/audio/migrations/0024_auto_20211107_0710.py @@ -0,0 +1,28 @@ +# Generated by Django 3.2.9 on 2021-11-07 15:10 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('audio', '0023_auto_20210403_0102'), + ] + + operations = [ + migrations.AlterField( + model_name='episode', + name='image_license', + field=models.SmallIntegerField(choices=[(1, 'Public Domain'), (2, 'Unknown'), (3, 'CC BY-SA 2.5'), (4, 'CC BY-SA 3.0'), (5, 'CC BY 3.0'), (6, 'CC BY 1.0'), (7, 'CC0 1.0'), (8, 'CC BY 4.0')], default=2), + ), + migrations.AlterField( + model_name='feed', + name='image_license', + field=models.SmallIntegerField(choices=[(1, 'Public Domain'), (2, 'Unknown'), (3, 'CC BY-SA 2.5'), (4, 'CC BY-SA 3.0'), (5, 'CC BY 3.0'), (6, 'CC BY 1.0'), (7, 'CC0 1.0'), (8, 'CC BY 4.0')], default=2), + ), + migrations.AlterField( + model_name='feed', + name='license', + field=models.SmallIntegerField(choices=[(1, 'Public Domain'), (2, 'Unknown'), (3, 'CC BY-SA 2.5'), (4, 'CC BY-SA 3.0'), (5, 'CC BY 3.0'), (6, 'CC BY 1.0'), (7, 'CC0 1.0'), (8, 'CC BY 4.0')], default=1), + ), + ] diff --git a/audio/tests/test_licensechoices.py b/audio/tests/test_licensechoices.py index f5bd432..ac81331 100644 --- a/audio/tests/test_licensechoices.py +++ b/audio/tests/test_licensechoices.py @@ -18,14 +18,15 @@ TEST_LICENSE_INFO = ( ('CC BY-SA 3.0', 'https://creativecommons.org/licenses/by-sa/3.0'), ('CC BY 3.0', 'https://creativecommons.org/licenses/by/3.0'), ('CC BY 1.0', 'https://creativecommons.org/licenses/by/1.0'), - ('CC0 1.0', 'https://creativecommons.org/publicdomain/zero/1.0') + ('CC0 1.0', 'https://creativecommons.org/publicdomain/zero/1.0'), + ('CC BY 4.0', 'https://creativecommons.org/licenses/by/4.0') ) class LicenseChoicesTestCase(SimpleTestCase): def test_license_choices(self): - self.assertEqual(len(LICENSE_CHOICES), 7) + self.assertEqual(len(LICENSE_CHOICES), 8) for i, x in enumerate(TEST_LICENSE_CHOICES): self.assertEqual(TEST_LICENSE_CHOICES[i], LICENSE_CHOICES[i])