add CC BY 4.0 license

This commit is contained in:
Trent Palmer 2021-11-07 08:19:34 -08:00
parent f00b2df592
commit bcb541ba85
3 changed files with 35 additions and 3 deletions

View File

@ -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')

View File

@ -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),
),
]

View File

@ -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])