summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBarry Warsaw2014-09-23 09:47:26 -0400
committerBarry Warsaw2014-09-23 09:47:26 -0400
commiteef73255db608785a55c055cbbfb800603671ff6 (patch)
treef7e0b4cd273fa24ad5c6048d39a4b8aa7521bc44 /src
parentad7a26a4383fd9f0034e1e50d8f4207adb5aa9f3 (diff)
downloadmailman-eef73255db608785a55c055cbbfb800603671ff6.tar.gz
mailman-eef73255db608785a55c055cbbfb800603671ff6.tar.zst
mailman-eef73255db608785a55c055cbbfb800603671ff6.zip
Diffstat (limited to 'src')
-rw-r--r--src/mailman/model/requests.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mailman/model/requests.py b/src/mailman/model/requests.py
index 335e1e002..7f996dded 100644
--- a/src/mailman/model/requests.py
+++ b/src/mailman/model/requests.py
@@ -105,6 +105,9 @@ class ListRequests:
data_hash = token
request = _Request(key, request_type, self.mailing_list, data_hash)
store.add(request)
+ # XXX The caller needs a valid id immediately, so flush the changes
+ # now to the SA transaction context. Otherwise .id would not be
+ # valid. Hopefully this has no unintended side-effects.
store.flush()
return request.id
@@ -148,7 +151,7 @@ class _Request(Model):
__tablename__ = 'request'
- id = Column(Integer, primary_key=True)# TODO: ???, default=AutoReload)
+ id = Column(Integer, primary_key=True)
key = Column(Unicode)
request_type = Column(Enum(RequestType))
data_hash = Column(LargeBinary)