Changeset 784

Show
Ignore:
Timestamp:
05/24/06 08:36:21 (3 years ago)
Author:
Blackhex
Message:

DiscussionPlugin:

Probably #384 bug fix.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • discussionplugin/0.9/tracdiscussion/core.py

    r783 r784  
    165165        elif mode == 'topic-add': 
    166166            req.perm.assert_permission('DISCUSSION_VIEW') 
    167             req.hdf['discussion.author'] = wiki_to_oneliner(req.args.get( 
    168               'body'), self.env) 
    169             req.hdf['discussion.body'] = wiki_to_html(req.args.get('body'), 
    170               self.env, req) 
     167 
     168            # Get from values 
     169            author = req.args.get('author') 
     170            body = req.args.get('body') 
     171 
     172            if author: 
     173                req.hdf['discussion.author'] = wiki_to_oneliner(author, self.env) 
     174            if body: 
     175                req.hdf['discussion.body'] = wiki_to_html(body, self.env, req) 
    171176        elif mode == 'topic-post-add': 
    172177            req.perm.assert_permission('DISCUSSION_VIEW') 
     
    186191        elif mode == 'message-list': 
    187192            req.perm.assert_permission('DISCUSSION_VIEW') 
     193 
     194            # Get form values 
     195            author = req.args.get('author') 
     196            body = req.args.get('body') 
     197 
    188198            if action == 'post-add': 
    189199                # Submit change? 
    190200                if submit: 
    191                     # Get form values 
    192                     author = req.args.get('author') 
    193                     body = req.args.get('body') 
    194  
    195201                    self.add_message(cursor, forum['id'], topic['id'], reply, 
    196202                      author, body) 
    197203 
    198204            # Display messages 
    199             req.hdf['discussion.body'] = wiki_to_html(req.args.get('body'), 
    200               self.env, req
    201             req.hdf['discussion.author'] = wiki_to_oneliner(req.args.get( 
    202               'author'), self.env
     205            if author: 
     206                req.hdf['discussion.author'] = wiki_to_oneliner(author, self.env
     207            if body: 
     208                req.hdf['discussion.body'] = wiki_to_html(body, self.env, req
    203209            req.hdf['discussion.messages'] = self.get_messages(cursor, 
    204210              topic['id'], req)