src/pyams_content/features/review/zmi/__init__.py
changeset 527 5dd1aa8bedd9
parent 462 610a330cb669
child 591 b694d5667d17
--- a/src/pyams_content/features/review/zmi/__init__.py	Wed Apr 11 16:44:46 2018 +0200
+++ b/src/pyams_content/features/review/zmi/__init__.py	Wed Apr 11 16:46:31 2018 +0200
@@ -136,24 +136,28 @@
     def get_ajax_output(self, changes):
         translate = self.request.localizer.translate
         if changes:
-            return {'status': 'success',
-                    'message': translate(_("Request successful. "
-                                           "{count} new notification(s) have been sent")).format(count=changes),
-                    'events': [{
-                        'event': 'myams.refresh',
-                        'options': {
-                            'handler': 'PyAMS_content.review.updateComments'
-                        }
-                    }]}
+            return {
+                'status': 'success',
+                'message': translate(_("Request successful. "
+                                       "{count} new notification(s) have been sent")).format(count=changes),
+                'events': [{
+                    'event': 'myams.refresh',
+                    'options': {
+                        'handler': 'PyAMS_content.review.updateComments'
+                    }
+                }]
+            }
         else:
-            return {'status': 'info',
-                    'message': translate(_("Request successful. No new notification have been sent")),
-                    'events': [{
-                        'event': 'myams.refresh',
-                        'options': {
-                            'handler': 'PyAMS_content.review.updateComments'
-                        }
-                    }]}
+            return {
+                'status': 'info',
+                'message': translate(_("Request successful. No new notification have been sent")),
+                'events': [{
+                    'event': 'myams.refresh',
+                    'options': {
+                        'handler': 'PyAMS_content.review.updateComments'
+                    }
+                }]
+            }
 
 
 #
@@ -257,8 +261,10 @@
         translate = request.localizer.translate
         comment_body = request.params.get('comment')
         if not comment_body:
-            return {'status': 'error',
-                    'message': translate(_("Message is mandatory!"))}
+            return {
+                'status': 'error',
+                'message': translate(_("Message is mandatory!"))
+            }
         # add new comment
         comments = IReviewComments(request.context)
         comment = ReviewComment(owner=request.principal.id,
@@ -274,7 +280,11 @@
                                      translate=query_utility(IChameleonTranslate),
                                      options={'comment': comment,
                                               'profile': profile})
-        return {'status': 'success',
-                'callback': 'PyAMS_content.review.addCommentCallback',
-                'options': {'content': comment_body,
-                            'count': len(comments)}}
+        return {
+            'status': 'success',
+            'callback': 'PyAMS_content.review.addCommentCallback',
+            'options': {
+                'content': comment_body,
+                'count': len(comments)
+            }
+        }