Skip to content

Commit

Permalink
Merge pull request #58 from interlegis/master
Browse files Browse the repository at this point in the history
Fixing TypeError when creating gist
  • Loading branch information
bartTC committed May 5, 2014
2 parents 6f0481a + f7e9544 commit 3944c4d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dpaste/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,10 @@ def snippet_gist(request, snippet_id): # pragma: no cover
"""
snippet = get_object_or_404(Snippet, secret_id=snippet_id)
data = {
'description': 'the description for this gist',
'description': getattr(settings, 'DPASTE_DEFAULT_GIST_DESCRIPTION', 'the description for this gist'),
'public': False,
'files': {
'dpaste.de_snippet.py': {
getattr(settings, 'DPASTE_DEFAULT_GIST_NAME', 'dpaste.de_snippet.py'): {
'content': snippet.content,
}
}
Expand All @@ -221,7 +221,7 @@ def snippet_gist(request, snippet_id): # pragma: no cover
try:
payload = json.dumps(data)
response = requests.post('https://api.github.com/gists', data=payload)
response_dict = json.loads(response.content)
response_dict = response.json()
gist_url = response_dict.get('html_url')

# Github could be down, could return invalid JSON, it's rare
Expand Down

0 comments on commit 3944c4d

Please sign in to comment.