|
3 | 3 | from __future__ import absolute_import
|
4 | 4 | from builtins import object
|
5 | 5 | import logging
|
| 6 | +import textwrap |
6 | 7 |
|
7 | 8 | from django.shortcuts import get_object_or_404
|
8 | 9 | from django.views.generic import ListView, DetailView
|
@@ -88,20 +89,26 @@ def get_context_data(self, **kwargs):
|
88 | 89 | "?title={title}{build_id}"
|
89 | 90 | "&body={body}")
|
90 | 91 |
|
91 |
| - body = ("# Details:\n\n" |
92 |
| - "*Project URL: https://readthedocs.org/projects/{projname}/\n" |
93 |
| - "*Build URL(if applicable): https://readthedocs.org{build_path}\n" |
94 |
| - "*Read the Docs username(if applicable): {uname}\n\n" |
95 |
| - "## Expected Result\n\n" |
96 |
| - "*A description of what you wanted to happen*\n\n" |
97 |
| - "## Actual Result\n\n" |
98 |
| - "*A description of what actually happened*").format( |
| 92 | + body = """ |
| 93 | + # Details: |
| 94 | +
|
| 95 | + *Project URL: https://readthedocs.org/projects/{projname}/ |
| 96 | + *Build URL(if applicable): https://readthedocs.org{build_path} |
| 97 | + *Read the Docs username(if applicable): {uname} |
| 98 | +
|
| 99 | + ## Expected Result |
| 100 | +
|
| 101 | + *A description of what you wanted to happen* |
| 102 | +
|
| 103 | + ## Actual Result |
| 104 | +
|
| 105 | + *A description of what actually happened*""".format( |
99 | 106 | projname=self.project, build_path=self.request.path,
|
100 | 107 | uname=self.request.user)
|
101 | 108 |
|
102 | 109 | scheme_dict = {'title': quote("Build error with build id #"),
|
103 | 110 | 'build_id': context['build'].id,
|
104 |
| - 'body': quote(body)} |
| 111 | + 'body': quote(textwrap.dedent(body))} |
105 | 112 |
|
106 | 113 | issue_url = scheme.format(**scheme_dict)
|
107 | 114 | issue_url = urlparse(issue_url).geturl()
|
|
0 commit comments