Browse Source

Rename "add_pd" to "add_pdc" (PagerDuty Connect).

pull/307/head
Pēteris Caune 5 years ago
parent
commit
7c1b9c4b96
No known key found for this signature in database GPG Key ID: E28D7679E9A9EDE2
5 changed files with 11 additions and 11 deletions
  1. +5
    -5
      hc/front/tests/test_add_pdc.py
  2. +2
    -2
      hc/front/urls.py
  3. +3
    -3
      hc/front/views.py
  4. +1
    -1
      templates/front/channels.html
  5. +0
    -0
      templates/integrations/add_pdc.html

hc/front/tests/test_add_pd.py → hc/front/tests/test_add_pdc.py View File


+ 2
- 2
hc/front/urls.py View File

@ -27,8 +27,8 @@ channel_urls = [
path("add_email/", views.add_email, name="hc-add-email"),
path("add_webhook/", views.add_webhook, name="hc-add-webhook"),
path("add_shell/", views.add_shell, name="hc-add-shell"),
path("add_pd/", views.add_pd, name="hc-add-pd"),
path("add_pd/<str:state>/", views.add_pd, name="hc-add-pd-state"),
path("add_pdc/", views.add_pdc, name="hc-add-pdc"),
path("add_pdc/<str:state>/", views.add_pdc, name="hc-add-pdc-state"),
path("add_pagertree/", views.add_pagertree, name="hc-add-pagertree"),
path("add_pagerteam/", views.add_pagerteam, name="hc-add-pagerteam"),
path("add_slack/", views.add_slack, name="hc-add-slack"),


+ 3
- 3
hc/front/views.py View File

@ -863,7 +863,7 @@ def _get_validated_code(request, session_key, key="code"):
return request.GET.get(key)
def add_pd(request, state=None):
def add_pdc(request, state=None):
if settings.PD_VENDOR_KEY is None:
raise Http404("pagerduty integration is not available")
@ -893,13 +893,13 @@ def add_pd(request, state=None):
return redirect("hc-channels")
state = _prepare_state(request, "pd")
callback = settings.SITE_ROOT + reverse("hc-add-pd-state", args=[state])
callback = settings.SITE_ROOT + reverse("hc-add-pdc-state", args=[state])
connect_url = "https://connect.pagerduty.com/connect?" + urlencode(
{"vendor": settings.PD_VENDOR_KEY, "callback": callback}
)
ctx = {"page": "channels", "project": request.project, "connect_url": connect_url}
return render(request, "integrations/add_pd.html", ctx)
return render(request, "integrations/add_pdc.html", ctx)
@login_required


+ 1
- 1
templates/front/channels.html View File

@ -259,7 +259,7 @@
<h2>PagerDuty</h2>
<p>On-call scheduling, alerting, and incident tracking.</p>
<a href="{% url 'hc-add-pd' %}" class="btn btn-primary">Add Integration</a>
<a href="{% url 'hc-add-pdc' %}" class="btn btn-primary">Add Integration</a>
</li>
{% endif %}


templates/integrations/add_pd.html → templates/integrations/add_pdc.html View File


Loading…
Cancel
Save