add GDFL to campaign choices

needed for framasoft translation of a Stallman book
pull/1/head
eric 2014-11-20 21:34:19 -05:00
parent 9e4c6b9a77
commit c87004122d
3 changed files with 5 additions and 2 deletions

View File

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

View File

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

View File

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