aboutsummaryrefslogtreecommitdiff
path: root/src/mailman_pgp/rest/lists.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman_pgp/rest/lists.py')
-rw-r--r--src/mailman_pgp/rest/lists.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mailman_pgp/rest/lists.py b/src/mailman_pgp/rest/lists.py
index 251ed7a..708635f 100644
--- a/src/mailman_pgp/rest/lists.py
+++ b/src/mailman_pgp/rest/lists.py
@@ -186,8 +186,14 @@ class AListKey:
except (ValueError, PGPError) as error:
bad_request(response, str(error))
return
+
+ key = values.pop('key')
+ if key.is_public:
+ bad_request(response, 'Cannot set a public key.')
+ return
+
with transaction():
- self._mlist.key = values.pop('key')
+ self._mlist.key = key
accepted(response)