Author: mbonetti
Date: Mon May  4 08:10:50 2009
New Revision: 498

Modified:
    branches/electron/pages/admin/views.py

Log:
fix: allow status changing for unsaved pages

Modified: branches/electron/pages/admin/views.py
==============================================================================
--- branches/electron/pages/admin/views.py      (original)
+++ branches/electron/pages/admin/views.py      Mon May  4 08:10:50 2009
@@ -13,10 +13,13 @@
      Switch the status of a page
      """
      if request.method == 'POST':
-        page = Page.objects.get(pk=page_id)
-        page.status = status
-        page.save()
-        return HttpResponse(unicode(page.status))
+        try:
+            page = Page.objects.get(pk=page_id)
+            page.status = status
+            page.save()
+            return HttpResponse(unicode(page.status))
+        except:
+            return HttpResponse(unicode(status))
      raise Http404
  change_status = staff_member_required(change_status)


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pinax-updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pinax-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to