Skip to content

[FIX] base_location_nuts: fix import_update_partner_nuts #2029

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

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from
Open
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
9 changes: 8 additions & 1 deletion base_location_nuts/wizard/nuts_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,15 @@ def _create_partner_nuts(self, nuts_data):
def import_update_partner_nuts(self):
self._load_countries()
query = self._get_query()
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36"
}

response = requests.get(
ENDPOINT, params={"format": "json", "query": query}, timeout=120
ENDPOINT,
params={"format": "json", "query": query},
timeout=120,
headers=headers,
)
try:
response.raise_for_status()
Expand Down