@login_required
def edit_media(request, media_id, media_type='image'):
 (media, media_format) = _get_media_info(media_id, media_type)
 check_media_permissions(media, request.user, 'change')
 if (media_type == 'image'):
  media_form = _init_media_form(ImageForm, request, media, ('locale', 'title'))
 else:
  raise Http404
 if ((request.method == 'POST') and media_form.is_valid()):
  media = media_form.save(update_user=request.user, is_draft=False)
  return HttpResponseRedirect(reverse('gallery.media', args=[media_type, media_id]))
 return render(request, 'gallery/edit_media.html', {'media': media, 'media_format': media_format, 'form': media_form, 'media_type': media_type})

@ login_required def edit_media ( request , media_id , media_type = 'image' ) : ( media , media_format ) = _get_media_info ( media_id , media_type ) check_media_permissions ( media , request . user , 'change' ) if ( media_type == 'image' ) : media_form = _init_media_form ( ImageForm , request , media , ( 'locale' , 'title' ) ) else : raise Http404 if ( ( request . method == 'POST' ) and media_form . is_valid ( ) ) : media = media_form . save ( update_user = request . user , is_draft = False ) return HttpResponseRedirect ( reverse ( 'gallery.media' , args = [ media_type , media_id ] ) ) return render ( request , 'gallery/edit_media.html' , { 'media' : media , 'media_format' : media_format , 'form' : media_form , 'media_type' : media_type } )
edit media means only changing the description .