From 1cf4df73ce62175b16f2a337e393b7318acf08e9 Mon Sep 17 00:00:00 2001 From: Liam Date: Thu, 5 Dec 2024 12:53:24 -0500 Subject: [PATCH] Fix system report generation --- lib/philomena/reports.ex | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/philomena/reports.ex b/lib/philomena/reports.ex index 7e0466dc..070e0ea5 100644 --- a/lib/philomena/reports.ex +++ b/lib/philomena/reports.ex @@ -133,17 +133,18 @@ defmodule Philomena.Reports do def create_system_report({reportable_type, reportable_id} = _type_and_id, category, reason) do attrs = %{ reason: reason, - category: category + category: category, + user_agent: "system" } - attributes = %{ + attribution = %{ system: true, ip: %Postgrex.INET{address: {127, 0, 0, 1}, netmask: 32}, fingerprint: "ffff" } %Report{reportable_type: reportable_type, reportable_id: reportable_id} - |> Report.creation_changeset(attrs, attributes) + |> Report.creation_changeset(attrs, attribution) |> Repo.insert() |> reindex_after_update() end