forked from GithubBackups/healthchecks
Fix the "Integrations" page for when the user has no active project
This commit is contained in:
parent
cdfc9840a7
commit
d5bae3d3d8
@ -9,6 +9,7 @@ All notable changes to this project will be documented in this file.
|
||||
|
||||
### Bug Fixes
|
||||
- Fix badges for tags containing special characters (#240, #237)
|
||||
- Fix the "Integrations" page for when the user has no active project
|
||||
|
||||
|
||||
## 1.7.0 - 2019-05-02
|
||||
|
@ -106,3 +106,11 @@ class ChannelsTestCase(BaseTestCase):
|
||||
|
||||
self.assertEqual(r.status_code, 200)
|
||||
self.assertContains(r, "SMS to +123")
|
||||
|
||||
def test_it_requires_current_project(self):
|
||||
self.profile.current_project = None
|
||||
self.profile.save()
|
||||
|
||||
self.client.login(username="alice@example.org", password="password")
|
||||
r = self.client.get("/integrations/")
|
||||
self.assertRedirects(r, "/")
|
||||
|
@ -560,6 +560,11 @@ def badges(request, code):
|
||||
|
||||
@login_required
|
||||
def channels(request):
|
||||
|
||||
if not request.project:
|
||||
# This can happen when the user deletes their only project.
|
||||
return redirect("hc-index")
|
||||
|
||||
if request.method == "POST":
|
||||
code = request.POST["channel"]
|
||||
try:
|
||||
|
Loading…
x
Reference in New Issue
Block a user