~barry/mailman/lp1423756

« back to all changes in this revision

Viewing changes to src/mailman/rest/validator.py

  • Committer: Barry Warsaw
  • Date: 2015-01-05 01:20:33 UTC
  • mfrom: (7264.4.66 py3)
  • Revision ID: barry@list.org-20150105012033-zdrw9c2odhpf22fz
Merge the Python 3 branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
"""REST web form validation."""
19
19
 
20
 
from __future__ import absolute_import, print_function, unicode_literals
21
 
 
22
 
__metaclass__ = type
23
20
__all__ = [
24
21
    'PatchValidator',
25
22
    'Validator',
29
26
    ]
30
27
 
31
28
 
32
 
from uuid import UUID
33
 
from zope.component import getUtility
34
 
 
35
29
from mailman.core.errors import (
36
30
    ReadOnlyPATCHRequestError, UnknownPATCHRequestError)
37
31
from mailman.interfaces.languages import ILanguageManager
 
32
from uuid import UUID
 
33
from zope.component import getUtility
38
34
 
39
35
 
40
36
COMMASPACE = ', '
62
58
    try:
63
59
        return UUID(int=int(subscriber))
64
60
    except ValueError:
65
 
        return unicode(subscriber)
 
61
        return subscriber
66
62
 
67
63
 
68
64
def language_validator(code):