Skip to content

Commit 22ff561

Browse files
- Azure_eu and include_metadata support added
- Live preview code updated - Security file added
1 parent 9ab3dc2 commit 22ff561

File tree

5 files changed

+3
-92
lines changed

5 files changed

+3
-92
lines changed

.github/workflows/pylint.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.github/workflows/python-app.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## _v1.8.0_
44

5-
### **Date: 23-MAY-2023**
5+
### **Date: 26-MAY-2023**
66

77
- AZURE_EU, Region support added
88
- Include Metadata support added to asset, entry and query

changelog.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*v1.8.0*
66
============
77

8-
**Date: 23-MAY-2023**
8+
**Date: 26-MAY-2023**
99

1010
- AZURE_EU, Region support added
1111
- Include Metadata support added to asset, entry and query

contentstack/https_connection.py

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,11 @@ def __get_os_platform():
2727
def user_agents():
2828
header = {'sdk': dict(name=contentstack.__package__,
2929
version=contentstack.__version__
30-
), 'os': __get_os_platform, 'Content-Type': 'application/json'}
30+
), 'os': __get_os_platform(), 'Content-Type': 'application/json'}
3131
package = f"{contentstack.__title__}/{contentstack.__version__}"
3232
return {'User-Agent': str(header), "X-User-Agent": package}
3333

3434

35-
def get_api_data(response):
36-
try:
37-
response.raise_for_status()
38-
except requests.exceptions.HTTPError as error:
39-
print(f"Error: {error}")
40-
return None
41-
else:
42-
return response.json()
43-
44-
4535
class HTTPSConnection: # R0903: Too few public methods
4636
def __init__(self, endpoint, headers, timeout, retry_strategy, live_preview):
4737
if None not in (endpoint, headers):
@@ -53,22 +43,6 @@ def __init__(self, endpoint, headers, timeout, retry_strategy, live_preview):
5343
self.retry_strategy = retry_strategy
5444
self.live_preview = live_preview
5545

56-
def impl_live_preview(self):
57-
if self.live_preview['enable']:
58-
host = self.live_preview['host']
59-
authorization = self.live_preview['authorization']
60-
ct = self.live_preview['content_type_uid']
61-
entry_uid = self.live_preview['entry_uid']
62-
url = f'https://{host}/v3/content_types/{ct}/entries'
63-
if entry_uid is not None:
64-
url = f'{url}/{entry_uid}'
65-
self.headers['authorization'] = authorization
66-
lp_resp = get_request(self.session, url, headers=self.headers, timeout=self.timeout)
67-
if lp_resp is not None and not 'error_code' in lp_resp:
68-
return lp_resp
69-
return None
70-
return None
71-
7246
def get(self, url):
7347
self.headers.update(user_agents())
7448
adapter = HTTPAdapter(max_retries=self.retry_strategy)

0 commit comments

Comments
 (0)