Skip to content

Commit

Permalink
fix post output settings for qa admin
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanhilbert committed Aug 17, 2015
1 parent 13b4d9a commit 74494e2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
34 changes: 17 additions & 17 deletions openspending/admin/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,23 +78,23 @@ def _write_loaded_data(self):

url = "/api/slicer/cube/geometry/cubes_aggregate?cubes=" + self.dataset.name + "&drilldown=geometry__time|geometry__country_level0@name&format=csv"

# Fill in your details here to be posted to the login form.
LOCKDOWN_FORCE = current_app.config.get("LOCKDOWNUSER", False)
LOCKDOWNUSER = current_app.config.get("LOCKDOWNUSER")
LOCKDOWNPASSWORD = current_app.config.get("LOCKDOWNUSER")
if LOCKDOWN_FORCE:
payload = {
'username': LOCKDOWNUSER,
'password': LOCKDOWNPASSWORD
}

client.post(url_for('home.lockdown'), data=payload)

print client
try:
postloadvalue = client.get(url).data
except Exception, e:
log.warn("Could Not find post load content for " + dataset.name)
with client:
# Fill in your details here to be posted to the login form.
LOCKDOWN_FORCE = current_app.config.get("LOCKDOWN_FORCE", False)
LOCKDOWNUSER = current_app.config.get("LOCKDOWNUSER")
LOCKDOWNPASSWORD = current_app.config.get("LOCKDOWNPASSWORD")
if LOCKDOWN_FORCE:
payload = {
'username': LOCKDOWNUSER,
'password': LOCKDOWNPASSWORD
}

client.post(url_for('home.lockdown'), data=payload, follow_redirects=True)

try:
postloadvalue = client.get(url, follow_redirects=True).data
except Exception, e:
log.warn("Could Not find post load content for " + dataset.name)

try:
self.zf.writestr("postloadvalue.csv", postloadvalue)
Expand Down
2 changes: 1 addition & 1 deletion settings.py_tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ UPLOADS_FOLDER = os.path.realpath('.') + '/datauploads/'
FILE_SYSTEM_STORAGE_FILE_VIEW = 'static'

#UploadSet Flask-uploads management of files
UPLOADED_FILES_DEST = os.path.realpath('.') + '/datauploads/'
UPLOADS_DEFAULT_DEST = os.path.realpath('.') + '/datauploads/'

#domain whitelist
EMAIL_WHITELIST = ['state.gov', 'whitehouse.gov']
Expand Down

0 comments on commit 74494e2

Please sign in to comment.