Skip to content

Commit

Permalink
[BUGFIX] Fix queries for promgen.Rule and promgen.Site #170
Browse files Browse the repository at this point in the history
  • Loading branch information
kfdm authored Aug 15, 2019
2 parents 7a4eca3 + dd9b829 commit 49e0387
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion promgen/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
class Site(django.contrib.sites.models.Site):
# Proxy model for sites so that we can easily
# query our related Rules
rule_set = GenericRelation('Rule')
rule_set = GenericRelation('promgen.Rule', for_concrete_model=False)

def get_absolute_url(self):
return reverse('rules-list')
Expand Down
4 changes: 2 additions & 2 deletions promgen/templates/promgen/rule_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ <h1>Rule: {{ rule.name }}</h1>
<table class="table">
<tr>
<td>
<a href="{% url 'rule-detail' rule.parent.id %}">{{rule.parent.name}}</a>
<a href="{{rule.parent.get_absolute_url}}">{{rule.parent.name}}</a>
</td>
<td>
<code v-pre data-href="{% url 'rule-test' r.id %}">
<code v-pre data-href="{% url 'rule-test' rule.parent.pk %}">
{{ rule.parent|rulemacro }}
</code>
</td>
Expand Down
2 changes: 1 addition & 1 deletion promgen/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
# Public API

# Legacy API
path('alert$', csrf_exempt(views.Alert.as_view())),
path('alert', csrf_exempt(views.Alert.as_view())),
path('api/v1/config', csrf_exempt(views.ApiConfig.as_view())),

# Promgen API
Expand Down

0 comments on commit 49e0387

Please sign in to comment.