Skip to content

Commit

Permalink
fix: Fix notifiation authorization check on pg13- (#234)
Browse files Browse the repository at this point in the history
Postgres 13 or lower don't have predefined roles, so we call unnest on an empty
python array which is emitted as '{}'.  This is ambiguous for postgres so we
need to explicitly cast the value as an array of text, which works for both an
empty array and a non empty array (which is emitted as ARRAY[...]).
  • Loading branch information
rjuju authored Nov 21, 2024
1 parent 121b76d commit f1cbdb9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion powa/dashboards.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def notify_allowed(self):
try:
cur.execute(
"""WITH s(v) AS (
SELECT unnest(%s)
SELECT unnest(%s::text[])
UNION ALL
SELECT rolname
FROM {powa}.powa_roles
Expand Down

0 comments on commit f1cbdb9

Please sign in to comment.