[PATCH 09 of 54] Allow Name and Organization in anAcknowledgment to be plural

Wald Commits scm-commit at wald.intevation.org
Wed Jan 7 10:56:26 CET 2015


# HG changeset patch
# User Benoît Allard <benoit.allard at greenbone.net>
# Date 1412765014 -7200
# Node ID cb8b2a196f0b67b16484fc25999cc01f7ea94beb
# Parent  c924c15bd11097abbd2c891d9fcc5b3c2a653957
Allow Name and Organization in anAcknowledgment to be plural

diff -r c924c15bd110 -r cb8b2a196f0b farolluz/cvrf.py
--- a/farolluz/cvrf.py	Wed Oct 08 11:35:53 2014 +0200
+++ b/farolluz/cvrf.py	Wed Oct 08 12:43:34 2014 +0200
@@ -231,18 +231,19 @@
 
 
 class CVRFAcknowledgment(object):
-    def __init__(self, name=None, organization=None, description=None,
+    def __init__(self, names=[], organizations=[], description=None,
                  url=None):
-        self._name = name
-        self._organization = organization
+        self._names = names
+        self._organizations = organizations
         self._description = description
         self._url = url
 
     def getTitle(self):
-        return "%s - %s" % (self._name, self._organization)
+        return "%s - %s" % (', '.join(self._names),
+                            ', '.join(self._organizations))
 
     def validate(self):
-        if (not self._name) and (not self._organization) and (not self._description):
+        if (not self._names) and (not self._organizations) and (not self._description):
             raise ValidationError('An Acknowledgment must have at least a Name, an Organization or a Description')
 
 


More information about the Farol-commits mailing list