merge
authorrbernard
Fri, 11 Dec 2009 11:48:10 +0100
changeset 57 b32aa76ee411
parent 56 bd8a4ffc7dad (current diff)
parent 55 2f46b4753efd (diff)
child 58 a480a91d63ca
merge
.pydevproject
src/cm/views/export.py
--- a/.hgignore	Fri Dec 11 11:17:01 2009 +0100
+++ b/.hgignore	Fri Dec 11 11:48:10 2009 +0100
@@ -27,4 +27,6 @@
 syntax: regexp
 ^bin$
 syntax: regexp
-^recreate$
\ No newline at end of file
+^recreate$
+syntax: regexp
+^\.pydevproject$
\ No newline at end of file
--- a/.pydevproject	Fri Dec 11 11:17:01 2009 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<?eclipse-pydev version="1.0"?>
-
-<pydev_project>
-<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.6</pydev_property>
-<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
-<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
-<path>/comt2/src</path>
-</pydev_pathproperty>
-</pydev_project>
--- a/src/cm/converters/__init__.py	Fri Dec 11 11:17:01 2009 +0100
+++ b/src/cm/converters/__init__.py	Fri Dec 11 11:48:10 2009 +0100
@@ -40,7 +40,7 @@
                        'text/english',
                        'text/enriched'
                       ]:
-        converted_input = input
+        converted_input = to_unicode(input)
         
     ##############################
     # anything looks like code: put them into markdown citation
--- a/src/cm/notifications.py	Fri Dec 11 11:17:01 2009 +0100
+++ b/src/cm/notifications.py	Fri Dec 11 11:48:10 2009 +0100
@@ -21,7 +21,7 @@
     
     activity = kwargs['instance']
     if activity.type in Activity.VIEWABLE_ACTIVITIES.get('view_users'): # user activity: only viewed by managers
-        notifications = Notification.objects.filter(text=None)
+        notifications = Notification.objects.filter(text=None, active=True)
         for notification in notifications:
             if notification.user:
                 from cm.security import user_has_perm # import here!
@@ -29,7 +29,7 @@
                     send_notification(activity, notification)
                     allready_notified.add(notification.user)
     elif activity.type in Activity.VIEWABLE_ACTIVITIES.get('view_comments'):
-        notifications = Notification.objects.filter(Q(text=activity.text) | Q(text=None))
+        notifications = Notification.objects.filter(Q(text=activity.text) | Q(text=None), active=True)
         for notification in notifications:            
             viewable = get_viewable_comments(FakeRequest(notification.user),
                                              Comment.objects.filter(id__in = [activity.comment.id]),
@@ -41,7 +41,7 @@
                     send_notification(activity, notification)
                     allready_notified.add(notification.user)            
     elif activity.type in Activity.VIEWABLE_ACTIVITIES.get('view_texts'):
-        notifications = Notification.objects.filter(Q(text=activity.text) | Q(text=None))
+        notifications = Notification.objects.filter(Q(text=activity.text) | Q(text=None), active=True)
         for notification in notifications:
             if notification.user:
                 from cm.security import user_has_perm # import here!
--- a/src/cm/views/export.py	Fri Dec 11 11:17:01 2009 +0100
+++ b/src/cm/views/export.py	Fri Dec 11 11:48:10 2009 +0100
@@ -102,7 +102,9 @@
     file_title = title + '.' + extension
     from email.header import Header
     encoded_name = str(Header(file_title.encode('utf8'), charset='utf8', maxlinelen=500))
-    response['Content-Disposition'] = u'attachment; filename=%s' % encoded_name
+    # TODO: find a way to include long (more than 76 chars) into header
+    encoded_name = encoded_name.replace('\n','')
+    response['Content-Disposition'] = 'attachment; filename=%s' % encoded_name
     response.write(content)
     return response