Skip to content

Commit

Permalink
Merge pull request ozgur#76 from yprez/fix-submitted-image-url
Browse files Browse the repository at this point in the history
Fix bug with submitted-image-url being empty or None
  • Loading branch information
ozgur committed Feb 15, 2015
2 parents 5057401 + 922ff39 commit 837e692
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions linkedin/linkedin.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,11 +292,13 @@ def submit_group_post(self, group_id, title, summary, submitted_url,
'title': title, 'summary': summary,
'content': {
'submitted-url': submitted_url,
'submitted-image-url': submitted_image_url,
'title': content_title,
'description': description
}
}
if submitted_image_url:
post['content']['submitted-image-url'] = submitted_image_url

url = '%s/%s/posts' % (ENDPOINTS.GROUPS, str(group_id))
response = self.make_request('POST', url, data=json.dumps(post))
raise_for_error(response)
Expand Down Expand Up @@ -402,9 +404,10 @@ def submit_company_share(self, company_id, comment=None, title=None, description
post['content'] = {
'title': title,
'submitted-url': submitted_url,
'submitted-image-url': submitted_image_url,
'description': description,
}
if submitted_image_url:
post['content']['submitted-image-url'] = submitted_image_url

url = '%s/%s/shares' % (ENDPOINTS.COMPANIES, company_id)

Expand Down Expand Up @@ -451,9 +454,10 @@ def submit_share(self, comment=None, title=None, description=None,
post['content'] = {
'title': title,
'submitted-url': submitted_url,
'submitted-image-url': submitted_image_url,
'description': description,
}
if submitted_image_url:
post['content']['submitted-image-url'] = submitted_image_url

url = '%s/~/shares' % ENDPOINTS.PEOPLE
response = self.make_request('POST', url, data=json.dumps(post))
Expand Down

0 comments on commit 837e692

Please sign in to comment.