[#3297] Bug lors de la resauvegarde d'une requête
authorPA Parent <paparent@paparent.me>
Fri, 8 Jun 2012 18:33:44 +0000 (14:33 -0400)
committerPA Parent <paparent@paparent.me>
Fri, 8 Jun 2012 18:33:44 +0000 (14:33 -0400)
src/qbe/django_qbe/admin.py

index 77dc37e..738730d 100644 (file)
@@ -44,8 +44,9 @@ class SavedQueryAdmin(admin.ModelAdmin):
 
     def save_model(self, request, obj, form, change):
         query_hash = request.GET.get("query_hash", "")
-        query_key = "qbe_query_%s" % query_hash
-        obj.query_data = request.session[query_key]
+        if query_hash:
+            query_key = "qbe_query_%s" % query_hash
+            obj.query_data = request.session[query_key]
 
         if not change:
             obj.user_created = request.user