Merge branch 'master' of git://gitorious.org/mediagoblin/mediagoblin
authorlora <lorochka85@gmail.com>
Sat, 19 Nov 2011 23:01:40 +0000 (17:01 -0600)
committerlora <lorochka85@gmail.com>
Sat, 19 Nov 2011 23:01:40 +0000 (17:01 -0600)
1  2 
mediagoblin/decorators.py
mediagoblin/templates/mediagoblin/user_pages/media.html
mediagoblin/templates/mediagoblin/user_pages/media_confirm_delete.html

index 38f52cedcb8979d791b4c99044c6c46b50e7b7d9,8f7532ec1704d1967ee9766c34135fd99a05d157..9cac1cfaa9fd1c1529e709cfde5cad389029f9fc
@@@ -58,9 -58,9 +58,9 @@@ def user_may_delete_media(controller)
      """
      def wrapper(request, *args, **kwargs):
          uploader = request.db.MediaEntry.find_one(
 -            {'_id': ObjectId(request.matchdict['media'])}).uploader()
 +            {'slug': request.matchdict['media'] }).uploader()
          if not (request.user['is_admin'] or
-                 request.user['_id'] == uploader['_id']):
+                 request.user._id == uploader._id):
              return exc.HTTPForbidden()
  
          return controller(request, *args, **kwargs)