diff -rc --exclude=.svn --exclude='*.pyc' --exclude='*~' --exclude='*.orig' ../django-svn/django/contrib/admin/views/main.py django/contrib/admin/views/main.py
*** ../django-svn/django/contrib/admin/views/main.py	Fri Jun  9 12:02:59 2006
--- django/contrib/admin/views/main.py	Fri Jun  9 12:25:05 2006
***************
*** 226,232 ****
      return render_to_response('admin/index.html', {'title': _('Site administration')}, context_instance=template.RequestContext(request))
  index = staff_member_required(never_cache(index))
  
! def add_stage(request, app_label, model_name, show_delete=False, form_url='', post_url=None, post_url_continue='../%s/', object_id_override=None):
      model = models.get_model(app_label, model_name)
      if model is None:
          raise Http404, "App %r, model %r, not found" % (app_label, model_name)
--- 226,232 ----
      return render_to_response('admin/index.html', {'title': _('Site administration')}, context_instance=template.RequestContext(request))
  index = staff_member_required(never_cache(index))
  
! def _add_stage(request, app_label, model_name, show_delete=False, form_url='', post_url=None, post_url_continue='../%s/', object_id_override=None):
      model = models.get_model(app_label, model_name)
      if model is None:
          raise Http404, "App %r, model %r, not found" % (app_label, model_name)
***************
*** 297,305 ****
          c['object_id'] = object_id_override
  
      return render_change_form(model, manipulator, c, add=True)
! add_stage = staff_member_required(never_cache(add_stage))
  
! def change_stage(request, app_label, model_name, object_id):
      model = models.get_model(app_label, model_name)
      object_id = unquote(object_id)
      if model is None:
--- 297,305 ----
          c['object_id'] = object_id_override
  
      return render_change_form(model, manipulator, c, add=True)
! add_stage = staff_member_required(never_cache(_add_stage))
  
! def _change_stage(request, app_label, model_name, object_id):
      model = models.get_model(app_label, model_name)
      object_id = unquote(object_id)
      if model is None:
***************
*** 396,402 ****
          'is_popup': request.REQUEST.has_key('_popup'),
      })
      return render_change_form(model, manipulator, c, change=True)
! change_stage = staff_member_required(never_cache(change_stage))
  
  def _nest_help(obj, depth, val):
      current = obj
--- 396,402 ----
          'is_popup': request.REQUEST.has_key('_popup'),
      })
      return render_change_form(model, manipulator, c, change=True)
! change_stage = staff_member_required(never_cache(_change_stage))
  
  def _nest_help(obj, depth, val):
      current = obj
***************
*** 482,488 ****
              if not user.has_perm(p):
                  perms_needed.add(related.opts.verbose_name)
  
! def delete_stage(request, app_label, model_name, object_id):
      import sets
      model = models.get_model(app_label, model_name)
      object_id = unquote(object_id)
--- 482,488 ----
              if not user.has_perm(p):
                  perms_needed.add(related.opts.verbose_name)
  
! def _delete_stage(request, app_label, model_name, object_id):
      import sets
      model = models.get_model(app_label, model_name)
      object_id = unquote(object_id)
***************
*** 518,524 ****
      return render_to_response(["admin/%s/%s/delete_confirmation.html" % (app_label, opts.object_name.lower() ),
                                 "admin/%s/delete_confirmation.html" % app_label ,
                                 "admin/delete_confirmation.html"], extra_context, context_instance=template.RequestContext(request))
! delete_stage = staff_member_required(never_cache(delete_stage))
  
  def history(request, app_label, model_name, object_id):
      model = models.get_model(app_label, model_name)
--- 518,524 ----
      return render_to_response(["admin/%s/%s/delete_confirmation.html" % (app_label, opts.object_name.lower() ),
                                 "admin/%s/delete_confirmation.html" % app_label ,
                                 "admin/delete_confirmation.html"], extra_context, context_instance=template.RequestContext(request))
! delete_stage = staff_member_required(never_cache(_delete_stage))
  
  def history(request, app_label, model_name, object_id):
      model = models.get_model(app_label, model_name)
***************
*** 725,736 ****
      def url_for_result(self, result):
          return "%s/" % quote(getattr(result, self.pk_attname))
  
! def change_list(request, app_label, model_name):
      model = models.get_model(app_label, model_name)
      if model is None:
          raise Http404, "App %r, model %r, not found" % (app_label, model_name)
!     if not request.user.has_perm(app_label + '.' + model._meta.get_change_permission()):
!         raise PermissionDenied
      try:
          cl = ChangeList(request, model)
      except IncorrectLookupParameters:
--- 725,737 ----
      def url_for_result(self, result):
          return "%s/" % quote(getattr(result, self.pk_attname))
  
! def _change_list(request, app_label, model_name, require_change_permission=True):
      model = models.get_model(app_label, model_name)
      if model is None:
          raise Http404, "App %r, model %r, not found" % (app_label, model_name)
!     if require_change_permission:
!         if not request.user.has_perm(app_label + '.' + model._meta.get_change_permission()):
!             raise PermissionDenied
      try:
          cl = ChangeList(request, model)
      except IncorrectLookupParameters:
***************
*** 741,746 ****
--- 742,749 ----
          # is screwed up with the database, so display an error page.
          if ERROR_FLAG in request.GET.keys():
              return render_to_response('admin/invalid_setup.html', {'title': _('Database error')})
+         if hasattr(request.user, 'message_set'):
+             request.user.message_set.create("Invalid lookup parameters were embedded in your last request.")
          return HttpResponseRedirect(request.path + '?' + ERROR_FLAG + '=1')
      c = template.RequestContext(request, {
          'title': cl.title,
***************
*** 751,754 ****
      return render_to_response(['admin/%s/%s/change_list.html' % (app_label, cl.opts.object_name.lower()),
                                 'admin/%s/change_list.html' % app_label,
                                 'admin/change_list.html'], context_instance=c)
! change_list = staff_member_required(never_cache(change_list))
--- 754,757 ----
      return render_to_response(['admin/%s/%s/change_list.html' % (app_label, cl.opts.object_name.lower()),
                                 'admin/%s/change_list.html' % app_label,
                                 'admin/change_list.html'], context_instance=c)
! change_list = staff_member_required(never_cache(_change_list))
