Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX] Fix queries for promgen.Rule and promgen.Site #170

Merged
merged 3 commits into from
Aug 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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