[csw-devel] SF.net SVN: gar:[20173] csw/mgar/gar/v2/lib/web/pkgdb_web.py

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Sat Jan 19 18:44:14 CET 2013


Revision: 20173
          http://gar.svn.sourceforge.net/gar/?rev=20173&view=rev
Author:   wahwah
Date:     2013-01-19 17:44:13 +0000 (Sat, 19 Jan 2013)
Log Message:
-----------
pkgdb-web: Return a 404 when svr4 is missing

The svr4 details page was crashing when asked for a nonexistent entry.

Modified Paths:
--------------
    csw/mgar/gar/v2/lib/web/pkgdb_web.py

Modified: csw/mgar/gar/v2/lib/web/pkgdb_web.py
===================================================================
--- csw/mgar/gar/v2/lib/web/pkgdb_web.py	2013-01-19 17:44:03 UTC (rev 20172)
+++ csw/mgar/gar/v2/lib/web/pkgdb_web.py	2013-01-19 17:44:13 UTC (rev 20173)
@@ -160,7 +160,10 @@
 
 class Srv4DetailFiles(object):
   def GET(self, md5_sum):
-    srv4 = models.Srv4FileStats.selectBy(md5_sum=md5_sum).getOne()
+    try:
+      srv4 = models.Srv4FileStats.selectBy(md5_sum=md5_sum).getOne()
+    except sqlobject.main.SQLObjectNotFound as e:
+      raise web.notfound()
     files = models.CswFile.selectBy(srv4_file=srv4)
     return render.Srv4DetailFiles(srv4, files)
 

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list