Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use_master when fetching external export metadata information #1760

Merged
merged 4 commits into from
Apr 8, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion onadata/libs/utils/export_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,13 @@ def clean_keys_of_slashes(record):


def _get_server_from_metadata(xform, meta, token):
report_templates = MetaData.external_export(xform)
# Fetch metadata details from master directly
try:
report_templates = MetaData.external_export(xform)
except MetaData.DoesNotExist:
from multidb.pinning import use_master
with use_master:
WinnyTroy marked this conversation as resolved.
Show resolved Hide resolved
report_templates = MetaData.external_export(xform)

WinnyTroy marked this conversation as resolved.
Show resolved Hide resolved
if meta:
try:
Expand Down