Changeset 1826

Show
Ignore:
Timestamp:
10/31/08 16:18:47 (2 months ago)
Author:
egj
Message:

refuse to delete comments if HTTP_METHOD is not POST; change PSM to not reference the comment name because comment names are not user-friendly (e.g. 'Comment comment.1 deleted')

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • siteapp/trunk/opengeo/almanac/content.py

    r1817 r1826  
    703703     
    704704    def render(self): 
    705         # XXX we should disallow GET 
    706705        name = self.context.__name__ 
    707706        parent = self.context.__parent__ 
    708         del parent[name] 
    709         self.flash(u'Comment %s deleted.' % name) 
     707 
     708        if self.request.method.upper() == 'POST': 
     709            del parent[name] 
     710            self.flash(u'Comment deleted.') 
     711        else: 
     712            self.flash(u('Please use the Delete button to delete comments.')) 
     713             
    710714        self.redirect(self.url(parent)) 
    711715