Return a HttpResponse in seed_db
Also moved the adding of the django patterns to where they belong so
that they do not get added multiple times.
Patch by: Sverre Rabbelier
--- a/app/soc/models/seed_db.py Tue Mar 10 21:08:30 2009 +0000
+++ b/app/soc/models/seed_db.py Tue Mar 10 23:55:33 2009 +0000
@@ -29,6 +29,8 @@
from google.appengine.api import memcache
from google.appengine.ext import db
+from django import http
+
from soc.logic.models.ranker_root import logic as ranker_root_logic
from soc.models import student_proposal
from soc.models.document import Document
@@ -323,7 +325,7 @@
memcache.flush_all()
- return
+ return http.HttpResponse('Done')
def clear(*args, **kwargs):
@@ -350,7 +352,8 @@
memcache.flush_all()
- return
+ return http.HttpResponse('Done')
+
def reseed(*args, **kwargs):
"""Clears and seeds the datastore.
@@ -358,3 +361,5 @@
clear(*args, **kwargs)
seed(*args, **kwargs)
+
+ return http.HttpResponse('Done')
--- a/app/soc/views/models/site.py Tue Mar 10 21:08:30 2009 +0000
+++ b/app/soc/views/models/site.py Tue Mar 10 23:55:33 2009 +0000
@@ -39,6 +39,7 @@
import soc.models.site
import soc.logic.models.site
import soc.logic.dicts
+import soc.logic.system
class View(presence_with_tos.View):
@@ -110,6 +111,11 @@
'soc.views.models.%(module_name)s.main_edit',
page_name)]
+ if soc.logic.system.isDebug():
+ patterns += [('^seed_db$', 'soc.models.seed_db.seed', "Seed DB"),
+ ('^clear_db$', 'soc.models.seed_db.clear', "Clear DB"),
+ ('^reseed_db$', 'soc.models.seed_db.reseed', "Reseed DB")]
+
new_params['extra_django_patterns'] = patterns
params = dicts.merge(params, new_params)
--- a/app/soc/views/sitemap/sitemap.py Tue Mar 10 21:08:30 2009 +0000
+++ b/app/soc/views/sitemap/sitemap.py Tue Mar 10 23:55:33 2009 +0000
@@ -22,9 +22,6 @@
]
-import soc.logic.system
-
-
SITEMAP = []
@@ -88,9 +85,4 @@
item = (url, module, kwargs, name)
patterns.append(item)
- if soc.logic.system.isDebug():
- patterns += [('^seed_db$', 'soc.models.seed_db.seed'),
- ('^clear_db$', 'soc.models.seed_db.clear'),
- ('^reseed_db$', 'soc.models.seed_db.reseed')]
-
return patterns