diff options
Diffstat (limited to 'src/mailman_pgp/utils/rest.py')
| -rw-r--r-- | src/mailman_pgp/utils/rest.py | 13 |
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: |
