Including mailing list on pullrequests/comments from Our-Own-Kallithea (OOK)

Thomas De Schampheleire patrickdepinguin at gmail.com
Sat Sep 24 13:21:27 UTC 2016


Hi,

Some of the Kallihea developers have an account on 'our-own-kallithea'
which they use to publish proposed Kallithea changes via a pull
request. This is all fine for the regular Kallithea developers that
also have an account there, but such pull requests are not by default
advertised to the mailing list.

I wonder if it is much more complex than following code (to be added
on OOK only):

diff --git a/kallithea/model/notification.py b/kallithea/model/notification.py
--- a/kallithea/model/notification.py
+++ b/kallithea/model/notification.py
@@ -106,6 +106,17 @@ class NotificationModel(BaseModel):
         if 'threading' in email_kwargs:
             headers = {'References': ' '.join('<%s>' % x for x in
email_kwargs['threading'])}

+        # also send to mailing list
+        if type_ in (Notification.TYPE_PULL_REQUEST,
Notification.TYPE_PULL_REQUEST_COMMENT,
Notification.TYPE_CHANGESET_COMMENT):
+            class DummyUser(object):
+                """Stub of User class, avoiding add to database"""
+                def __init__(self, email):
+                    self.email = email
+
+            # TODO check if mailing lists are to be sent for this repo
+            log.debug('Additionally sending notification (type %s to
mailing list', type_)
+            rec_objs.add(DummyUser('kallithea at example.com'))
+
         # send email with notification to all other participants
         for rec in rec_objs:
             ## this is passed into template


Where the TODO needs to be still handled...

Thanks,
Thomas


More information about the kallithea-general mailing list