You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by je...@apache.org on 2014/08/19 14:21:24 UTC

[09/10] git commit: [#7593] ticket:636 set by param to required and added g.markdown.convert to the message

[#7593] ticket:636 set by param to required and added g.markdown.convert to the message


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/29ccc56f
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/29ccc56f
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/29ccc56f

Branch: refs/heads/je/42cc_7593
Commit: 29ccc56fd241f3d398b762b9725ec6b5f8a3188b
Parents: 206fcd5
Author: discort <le...@bk.ru>
Authored: Tue Aug 19 12:12:15 2014 +0300
Committer: discort <le...@bk.ru>
Committed: Tue Aug 19 12:15:06 2014 +0300

----------------------------------------------------------------------
 Allura/allura/controllers/site_admin.py              | 4 +++-
 Allura/allura/ext/admin/templates/widgets/audit.html | 2 +-
 Allura/allura/model/auth.py                          | 6 ++++--
 3 files changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/29ccc56f/Allura/allura/controllers/site_admin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/site_admin.py b/Allura/allura/controllers/site_admin.py
index 27b0ed9..68af897 100644
--- a/Allura/allura/controllers/site_admin.py
+++ b/Allura/allura/controllers/site_admin.py
@@ -28,6 +28,7 @@ from pylons import tmpl_context as c
 from pylons import request
 from formencode import validators, Invalid
 from webob.exc import HTTPNotFound
+import HTMLParser
 
 from allura.app import SitemapEntry
 from allura.lib import helpers as h
@@ -278,12 +279,13 @@ class SiteAdminController(object):
         comment = kw.get('comment')
         user = M.User.by_username(username)
         if user and not user.is_anonymous() and comment:
-            M.AuditLog.comment_user(comment, by=c.user, user=user)
+            M.AuditLog.comment_user(c.user, comment, user=user)
             flash('Comment added', 'ok')
         else:
             flash('Can not add comment "%s" for user %s' % (comment, user))
         redirect(request.referer)
 
+
 class TaskManagerController(object):
 
     def _check_security(self):

http://git-wip-us.apache.org/repos/asf/allura/blob/29ccc56f/Allura/allura/ext/admin/templates/widgets/audit.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/templates/widgets/audit.html b/Allura/allura/ext/admin/templates/widgets/audit.html
index e26f075..36de8ae 100644
--- a/Allura/allura/ext/admin/templates/widgets/audit.html
+++ b/Allura/allura/ext/admin/templates/widgets/audit.html
@@ -37,7 +37,7 @@
           <td>{{ entry.url_str }}</td>
         </tr>
         <tr>
-          <td></td><td colspan="2">{{ entry.message }}</td>
+          <td></td><td colspan="2">{{ g.markdown.convert(entry.message)|safe }}</td>
         </tr>
         {% endfor %}
       </tbody>

http://git-wip-us.apache.org/repos/asf/allura/blob/29ccc56f/Allura/allura/model/auth.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/auth.py b/Allura/allura/model/auth.py
index 509b60a..8681710 100644
--- a/Allura/allura/model/auth.py
+++ b/Allura/allura/model/auth.py
@@ -41,6 +41,7 @@ from ming.orm import FieldProperty, RelationProperty, ForeignIdProperty
 from ming.orm.declarative import MappedClass
 from ming.orm.ormsession import ThreadLocalORMSession
 from ming.utils import LazyProperty
+from ming.schema import ParticularScalar
 
 import allura.tasks.mail_tasks
 from allura.lib import helpers as h
@@ -863,6 +864,7 @@ class ProjectRole(MappedClass):
         return self.query.find(dict(project_id=project._id,
                                     user_id={'$ne': None}, roles=self._id)).all()
 
+
 audit_log = collection(
     'audit_log', main_doc_session,
     Field('_id', S.ObjectId()),
@@ -916,11 +918,11 @@ class AuditLog(object):
         return cls.log(message, *args, **kwargs)
 
     @classmethod
-    def comment_user(cls, message, *args, **kwargs):
-        by = kwargs.pop('by', c.user)
+    def comment_user(cls, by, message, *args, **kwargs):
         message = u'Comment by %s: %s' % (by.username, message)
         return cls.log_user(message, *args, **kwargs)
 
+
 main_orm_session.mapper(AuditLog, audit_log, properties=dict(
     project_id=ForeignIdProperty('Project'),
     project=RelationProperty('Project'),