diff options
| author | Barry Warsaw | 2016-07-14 10:01:27 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2016-07-14 10:01:27 -0400 |
| commit | 3387791beb7112dbe07664041f117fdcc20df53d (patch) | |
| tree | 9a5506f88f61f221b0ad62db974d7995790ad62e /src/mailman/rest/listconf.py | |
| parent | 9b31555c180aa703d6fed0dc2cbaeda51de124c3 (diff) | |
| download | mailman-3387791beb7112dbe07664041f117fdcc20df53d.tar.gz mailman-3387791beb7112dbe07664041f117fdcc20df53d.tar.zst mailman-3387791beb7112dbe07664041f117fdcc20df53d.zip | |
Diffstat (limited to 'src/mailman/rest/listconf.py')
| -rw-r--r-- | src/mailman/rest/listconf.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mailman/rest/listconf.py b/src/mailman/rest/listconf.py index 65ce8c5f7..3294ba8b6 100644 --- a/src/mailman/rest/listconf.py +++ b/src/mailman/rest/listconf.py @@ -68,6 +68,12 @@ def pipeline_validator(pipeline_name): raise ValueError('Unknown pipeline: {}'.format(pipeline_name)) +def password_bytes_validator(value): + if value is None or isinstance(value, bytes): + return value + return config.password_context.encrypt(value).encode('utf-8') + + # This is the list of IMailingList attributes that are exposed through the # REST API. The values of the keys are the GetterSetter instance holding the # decoder used to convert the web request string to an internally valid value. @@ -120,6 +126,7 @@ ATTRIBUTES = dict( last_post_at=GetterSetter(None), leave_address=GetterSetter(None), list_name=GetterSetter(None), + moderator_password=GetterSetter(password_bytes_validator), next_digest_number=GetterSetter(None), no_reply_address=GetterSetter(None), owner_address=GetterSetter(None), |
