Skip to content

Commit

Permalink
[IMPROVEMENT] Audit logs: Show projects for services #472
Browse files Browse the repository at this point in the history
  • Loading branch information
kfdm authored Jan 22, 2024
2 parents 63163c2 + fb9336a commit f6a00ef
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions promgen/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,12 @@ def get_queryset(self):
content_type_id=ContentType.objects.get_for_model(models.Rule).id,
object_id__in=obj.rule_set.values_list("id", flat=True),
)
if key == "service":
# Only services may have projects
qset |= Q(
content_type_id=ContentType.objects.get_for_model(models.Project).id,
object_id__in=obj.project_set.values_list("id", flat=True),
)
if key == "project":
# Only projects may have exporters
qset |= Q(
Expand Down

0 comments on commit f6a00ef

Please sign in to comment.