-- PostgreSQL database dump
--
-\restrict 8YknpWlB9eR9ncLt3ecgbxk8MuuGNYlcvtjH1Z5RakC9PZdxunARHhe6aujfak2
+\restrict O4KmJp4fm1WQRL3AwvOlZctAfBgsUgl2VKAckcThLrnSZl3pdImWPTfY4j1qC83
--- Dumped from database version 17.6 (Debian 17.6-0+deb13u1)
--- Dumped by pg_dump version 17.6 (Debian 17.6-0+deb13u1)
+-- Dumped from database version 17.7 (Debian 17.7-0+deb13u1)
+-- Dumped by pg_dump version 17.7 (Debian 17.7-0+deb13u1)
SET statement_timeout = 0;
SET lock_timeout = 0;
closed_by text,
comment text DEFAULT ''::text NOT NULL,
block boolean DEFAULT true,
- accepted boolean DEFAULT false,
- notified_at timestamp with time zone
+ accepted boolean DEFAULT false
);
-- PostgreSQL database dump complete
--
-\unrestrict 8YknpWlB9eR9ncLt3ecgbxk8MuuGNYlcvtjH1Z5RakC9PZdxunARHhe6aujfak2
+\unrestrict O4KmJp4fm1WQRL3AwvOlZctAfBgsUgl2VKAckcThLrnSZl3pdImWPTfY4j1qC83
# Fetch all pending reports that have not been notified, yet
reports = self.backend.db.fetch(
sqlmodel
- .update(
+ .select(
Report,
)
- .values(
- notified_at = sqlmodel.func.current_timestamp(),
- )
.where(
# Reports must be open
Report.closed_at == None,
-
- # Reports must not have been notified, yet
- Report.notified_at == None,
)
- .returning(
- Report,
+ .order_by(
+ Report.reported_at
)
)
# Update the list's stats
self.list.update_stats()
- # Notified At
- notified_at: datetime.datetime | None = None
-
def _send_opening_notification(self):
"""
Sends a notification to the reporter when this report is opened.