aboutsummaryrefslogtreecommitdiff
path: root/src/mailman_pgp/utils/rest.py
diff options
context:
space:
mode:
authorJ08nY2017-08-15 22:47:29 +0200
committerJ08nY2017-08-15 22:47:29 +0200
commite979464e4cd836cdbfffbb2b803edb71b21a3a86 (patch)
tree3a065af63f5be4b90f44c69fa5b7ff1c1acae541 /src/mailman_pgp/utils/rest.py
parenta490ae84fe34afdd87edfeaa14d3d35cdd414487 (diff)
downloadmailman-pgp-e979464e4cd836cdbfffbb2b803edb71b21a3a86.tar.gz
mailman-pgp-e979464e4cd836cdbfffbb2b803edb71b21a3a86.tar.zst
mailman-pgp-e979464e4cd836cdbfffbb2b803edb71b21a3a86.zip
Diffstat (limited to 'src/mailman_pgp/utils/rest.py')
-rw-r--r--src/mailman_pgp/utils/rest.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/mailman_pgp/utils/rest.py b/src/mailman_pgp/utils/rest.py
index 4e31b0c..a44575c 100644
--- a/src/mailman_pgp/utils/rest.py
+++ b/src/mailman_pgp/utils/rest.py
@@ -14,6 +14,7 @@
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
+import ast
class enumflag_validator:
@@ -26,8 +27,16 @@ class enumflag_validator:
for val in value:
result.add(self.enum[val])
return result
-
- return {self.enum[value]}
+ if value in self.enum:
+ return {self.enum[value]}
+ else:
+ l = ast.literal_eval(value)
+ if isinstance(l, (list, tuple)):
+ result = set()
+ for val in l:
+ result.add(self.enum[val])
+ return result
+ raise ValueError
class workflow_validator: