#12065: URL clash between FlatPages causes middleware error
--------------------------+-------------------------------------------------
 Reporter:  emes          |       Owner:  nobody    
   Status:  new           |   Milestone:            
Component:  Contrib apps  |     Version:  1.1       
 Keywords:                |       Stage:  Unreviewed
Has_patch:  0             |  
--------------------------+-------------------------------------------------
 Steps to reproduce:
  1. Install flatpages app, as described in the documentation.
  1. Create flatpage with URL /bar/ and assign it to site foo.
  1. Create another flatpage with URL /bar/ and also assign it to site foo.
  1. Go to http://foo/bar/

 It looks FUBAR, I mean 500. This is not a good way to handle it, even if
 admins receive an email about exception. Why?

 Usually content editors are not admins. After adding such page, they can
 only guess what happened and why the content doesn't appear.

 The attached patch fixes it. It does two things:
  1. Validates flatpage when saved through admin panel. If there is an URL
 clash for some of the sites, validation errors are generated for 'sites'
 field.
  1. For installations where a clash has already occured and is present in
 the database, it just serves the first page found by query. It may be
 misleading to hide the error, but I assume that (i) it's better to serve
 content than 500 to end user and (ii) any doubt would eventually cause
 content editor to go to the admin panel and try to edit the page, running
 the new validation.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/12065>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to