Compare commits
No commits in common. "60b69684368b5336db096bc7a11acde8a2be5b9c" and "d361767471b20369e8f8ac9cf7121bd761da8a2b" have entirely different histories.
60b6968436
...
d361767471
@ -6,7 +6,6 @@ Created on: 19.08.22
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
import json
|
import json
|
||||||
from json import JSONDecodeError
|
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
from django.contrib.auth.decorators import login_required
|
from django.contrib.auth.decorators import login_required
|
||||||
@ -14,8 +13,6 @@ from django.http import JsonResponse, HttpRequest
|
|||||||
from django.utils.decorators import method_decorator
|
from django.utils.decorators import method_decorator
|
||||||
from django.utils.http import urlencode
|
from django.utils.http import urlencode
|
||||||
from django.views import View
|
from django.views import View
|
||||||
from django.utils.translation import gettext_lazy as _
|
|
||||||
|
|
||||||
from requests.auth import HTTPDigestAuth
|
from requests.auth import HTTPDigestAuth
|
||||||
|
|
||||||
from konova.sub_settings.proxy_settings import PROXIES, CLIENT_PROXY_AUTH_USER, CLIENT_PROXY_AUTH_PASSWORD
|
from konova.sub_settings.proxy_settings import PROXIES, CLIENT_PROXY_AUTH_USER, CLIENT_PROXY_AUTH_PASSWORD
|
||||||
@ -60,18 +57,7 @@ class ClientProxyParcelSearch(BaseClientProxyView):
|
|||||||
def get(self, request: HttpRequest):
|
def get(self, request: HttpRequest):
|
||||||
url = request.META.get("QUERY_STRING")
|
url = request.META.get("QUERY_STRING")
|
||||||
content, response_code = self.perform_url_call(url)
|
content, response_code = self.perform_url_call(url)
|
||||||
try:
|
|
||||||
body = json.loads(content)
|
body = json.loads(content)
|
||||||
except JSONDecodeError as e:
|
|
||||||
body = {
|
|
||||||
"totalResultsCount": -1,
|
|
||||||
"geonames": [
|
|
||||||
{
|
|
||||||
"title": _("The external service is currently unavailable.<br>Please try again in a few moments...")
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
if response_code != 200:
|
if response_code != 200:
|
||||||
return JsonResponse({
|
return JsonResponse({
|
||||||
"status_code": response_code,
|
"status_code": response_code,
|
||||||
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user