summaryrefslogtreecommitdiff
path: root/src/mailman/database
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman/database')
-rw-r--r--src/mailman/database/schema/mm_20120407000000.py6
-rw-r--r--src/mailman/database/types.py8
2 files changed, 7 insertions, 7 deletions
diff --git a/src/mailman/database/schema/mm_20120407000000.py b/src/mailman/database/schema/mm_20120407000000.py
index 8855df5af..0b1e51386 100644
--- a/src/mailman/database/schema/mm_20120407000000.py
+++ b/src/mailman/database/schema/mm_20120407000000.py
@@ -67,11 +67,11 @@ def upgrade(database, store, version, module_path):
def archive_policy(archive, archive_private):
"""Convert archive and archive_private to archive_policy."""
if archive == 0:
- return int(ArchivePolicy.never)
+ return ArchivePolicy.never.value
elif archive_private == 1:
- return int(ArchivePolicy.private)
+ return ArchivePolicy.private.value
else:
- return int(ArchivePolicy.public)
+ return ArchivePolicy.public.value
diff --git a/src/mailman/database/types.py b/src/mailman/database/types.py
index 42f64a640..86d504ca3 100644
--- a/src/mailman/database/types.py
+++ b/src/mailman/database/types.py
@@ -32,7 +32,7 @@ from storm.variables import Variable
class _EnumVariable(Variable):
- """Storm variable for supporting flufl.enum.Enum types.
+ """Storm variable for supporting enum types.
To use this, make the database column a INTEGER.
"""
@@ -46,18 +46,18 @@ class _EnumVariable(Variable):
return None
if not from_db:
return value
- return self._enum[value]
+ return self._enum(value)
def parse_get(self, value, to_db):
if value is None:
return None
if not to_db:
return value
- return int(value)
+ return value.value
class Enum(SimpleProperty):
- """Custom Enum type for Storm supporting flufl.enum.Enums."""
+ """Custom type for Storm supporting enums."""
variable_class = _EnumVariable