aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/edit
diff options
context:
space:
mode:
authorlora <lorochka85@gmail.com>2011-11-19 17:01:40 -0600
committerlora <lorochka85@gmail.com>2011-11-19 17:01:40 -0600
commit707001950a42c7adfd6657f227a2c2dbbd09afce (patch)
tree9a7215448098b8681b2b45fe636eb8af6c3ea8ba /mediagoblin/edit
parent2d62e9efd210becd30982e65e06a6ef97029b391 (diff)
parentaea6d577cbf4d937427dea173f74fb17ad45bd75 (diff)
downloadmediagoblin-707001950a42c7adfd6657f227a2c2dbbd09afce.tar.lz
mediagoblin-707001950a42c7adfd6657f227a2c2dbbd09afce.tar.xz
mediagoblin-707001950a42c7adfd6657f227a2c2dbbd09afce.zip
Merge branch 'master' of git://gitorious.org/mediagoblin/mediagoblin
Diffstat (limited to 'mediagoblin/edit')
-rw-r--r--mediagoblin/edit/__init__.py2
-rw-r--r--mediagoblin/edit/lib.py2
-rw-r--r--mediagoblin/edit/views.py10
3 files changed, 6 insertions, 8 deletions
diff --git a/mediagoblin/edit/__init__.py b/mediagoblin/edit/__init__.py
index 576bd0f5..ba347c69 100644
--- a/mediagoblin/edit/__init__.py
+++ b/mediagoblin/edit/__init__.py
@@ -13,5 +13,3 @@
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-
diff --git a/mediagoblin/edit/lib.py b/mediagoblin/edit/lib.py
index b722e9c1..458b704e 100644
--- a/mediagoblin/edit/lib.py
+++ b/mediagoblin/edit/lib.py
@@ -17,7 +17,7 @@
def may_edit_media(request, media):
"""Check, if the request's user may edit the media details"""
- if media['uploader'] == request.user['_id']:
+ if media['uploader'] == request.user._id:
return True
if request.user['is_admin']:
return True
diff --git a/mediagoblin/edit/views.py b/mediagoblin/edit/views.py
index a6ddb553..5f781552 100644
--- a/mediagoblin/edit/views.py
+++ b/mediagoblin/edit/views.py
@@ -57,7 +57,7 @@ def edit_media(request, media):
existing_user_slug_entries = request.db.MediaEntry.find(
{'slug': request.POST['slug'],
'uploader': media['uploader'],
- '_id': {'$ne': media['_id']}}).count()
+ '_id': {'$ne': media._id}}).count()
if existing_user_slug_entries:
form.slug.errors.append(
@@ -78,7 +78,7 @@ def edit_media(request, media):
location=media.url_for_self(request.urlgen))
if request.user['is_admin'] \
- and media['uploader'] != request.user['_id'] \
+ and media['uploader'] != request.user._id \
and request.method != 'POST':
messages.add_message(
request, messages.WARNING,
@@ -104,7 +104,7 @@ def edit_attachments(request, media):
attachment_public_filepath \
= mg_globals.public_store.get_unique_filepath(
- ['media_entries', unicode(media['_id']), 'attachment',
+ ['media_entries', unicode(media._id), 'attachment',
secure_filename(request.POST['attachment_file'].filename)])
attachment_public_file = mg_globals.public_store.get_file(
@@ -120,7 +120,7 @@ def edit_attachments(request, media):
name=request.POST['attachment_name'] \
or request.POST['attachment_file'].filename,
filepath=attachment_public_filepath,
- created=datetime.utcnow()
+ created=datetime.utcnow(),
))
media.save()
@@ -170,7 +170,7 @@ def edit_profile(request):
messages.add_message(request,
messages.SUCCESS,
- 'Profile edited!')
+ _("Profile edited!"))
return redirect(request,
'mediagoblin.user_pages.user_home',
user=edit_username)