]> git.ozlabs.org Git - patchwork/blobdiff - apps/patchwork/utils.py
notifications: add project name to patch update notification
[patchwork] / apps / patchwork / utils.py
index 1771167ae12f35fb55479c35aa865be496ce2664..f8fee3fcaaa1c8d0db9e5d50b4989ac75ae9ef3c 100644 (file)
@@ -105,6 +105,9 @@ def set_bundle(user, project, action, data, patches, context):
     bundle = None
     if action == 'create':
         bundle_name = data['bundle_name'].strip()
+        if '/' in bundle_name:
+            return ['Bundle names can\'t contain slashes']
+
         if not bundle_name:
             return ['No bundle name was specified']
 
@@ -172,6 +175,7 @@ def send_notifications():
 
     for (recipient, notifications) in groups:
         notifications = list(notifications)
+        projects = set([ n.patch.project.linkname for n in notifications ])
 
         def delete_notifications():
             PatchChangeNotification.objects.filter(
@@ -185,7 +189,9 @@ def send_notifications():
             'site': Site.objects.get_current(),
             'person': recipient,
             'notifications': notifications,
+            'projects': projects,
         }
+
         subject = render_to_string(
                         'patchwork/patch-change-notification-subject.text',
                         context).strip()