From c87004122dc928c5176f0267a9ee461f9b1441b6 Mon Sep 17 00:00:00 2001 From: eric Date: Thu, 20 Nov 2014 21:34:19 -0500 Subject: [PATCH] add GDFL to campaign choices needed for framasoft translation of a Stallman book --- core/cc.py | 3 ++- core/models.py | 2 +- frontend/forms.py | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/core/cc.py b/core/cc.py index 86d5a69f..eef6e442 100644 --- a/core/cc.py +++ b/core/cc.py @@ -10,8 +10,8 @@ INFO_CC = ( ('CC BY', 'by', 'Creative Commons Attribution 3.0 Unported (CC BY 3.0)', 'http://creativecommons.org/licenses/by/3.0/'), ('CC0', 'cc0', 'No Rights Reserved (CC0)', 'http://creativecommons.org/about/cc0'), ) +INFO_FREE = INFO_CC + (('GFDL', 'gdfl', 'GNU Free Documentation License', 'http://www.gnu.org/licenses/fdl-1.3-standalone.html'),) INFO_PD = ( - ('GFDL', 'gdfl', 'GNU Free Documentation License', 'http://www.gnu.org/licenses/fdl-1.3-standalone.html'), ('PD-US', 'pd-us', 'Public Domain, US', 'http://creativecommons.org/about/pdm'), ) INFO_ALL = INFO_CC + INFO_PD @@ -19,6 +19,7 @@ INFO_ALL = INFO_CC + INFO_PD # CONTENT_TYPES will be easiest to manipulate in ungluify_record as a dict CCCHOICES = tuple([(item[0],item[2]) for item in INFO_CC]) +FREECHOICES = tuple([(item[0],item[2]) for item in INFO_FREE]) CHOICES = tuple([(item[0],item[2]) for item in INFO_ALL]) diff --git a/core/models.py b/core/models.py index c4291590..f85a20d5 100755 --- a/core/models.py +++ b/core/models.py @@ -377,7 +377,7 @@ class Hold(models.Model): return Hold.objects.filter(work=self.work,library=self.library,created__lt=self.created).count() class Campaign(models.Model): - LICENSE_CHOICES = cc.CCCHOICES + LICENSE_CHOICES = cc.FREECHOICES created = models.DateTimeField(auto_now_add=True,) name = models.CharField(max_length=500, null=True, blank=False) description = RichTextField(null=True, blank=False) diff --git a/frontend/forms.py b/frontend/forms.py index f1f76dea..b62ca957 100644 --- a/frontend/forms.py +++ b/frontend/forms.py @@ -546,6 +546,8 @@ def getManageCampaignForm ( instance, data=None, initial=None, *args, **kwargs ) raise forms.ValidationError(_('The proposed license for an ACTIVE campaign may not add restrictions.')) elif self.instance.license == 'CC0' : raise forms.ValidationError(_('The proposed license for an ACTIVE campaign may not add restrictions.')) + elif self.instance.license == 'GDFL' : + raise forms.ValidationError(_('Once you start a campaign with GDFL, you can\'t use any other license.')) return new_license return ManageCampaignForm(instance = instance, data=data, initial=initial)