Commit dd10f2c3 authored by Michal Čihař's avatar Michal Čihař

Include username in hosting requests

Fixes #845
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent f010757c
......@@ -418,6 +418,10 @@ class ViewTest(TestCase):
mail.outbox[0].subject,
'[Weblate] Hosting request for HOST'
)
self.assertIn(
'testuser',
mail.outbox[0].body,
)
def test_contact_subject(self):
# With set subject
......
......@@ -68,6 +68,7 @@ Project: %(project)s
Website: %(url)s
Repository: %(repo)s
Filemask: %(mask)s
Username: %(username)s
Additional message:
......@@ -286,11 +287,13 @@ def hosting(request):
if request.method == 'POST':
form = HostingForm(request.POST)
if form.is_valid():
context = form.cleaned_data
context['username'] = request.user.username
mail_admins_contact(
request,
'Hosting request for %(project)s',
HOSTING_TEMPLATE,
form.cleaned_data,
context,
form.cleaned_data['email'],
)
return redirect('home')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment