Commit graph

3239 commits

Author SHA1 Message Date
Pēteris Caune
0aa21d5ac8
Update mypy.ini, remove a few "ignore_missing_imports"
fido2, apprise, braintree, urllib3 now have type hints,
so don't need "ignore_missing_imports" in mypy.ini any more, nice!
2023-10-18 16:56:58 +03:00
Pēteris Caune
fdfe03158d
Fix mypy warnings 2023-10-18 16:33:15 +03:00
Pēteris Caune
1aec03dfc6
Improve type hints in management commands 2023-10-18 16:15:01 +03:00
Pēteris Caune
e8be347d1a
Improve type hints in management commands 2023-10-18 13:47:02 +03:00
Pēteris Caune
ce622da6bd
Improve type hints and remove threading support which was unused
sendalerts had support for sending notifications
synchronously (with the --no-threads flag) and asynchronously using
threads (the default).

It turns out there was a bug in argument handling and sendalerts
was always using the synchronous mode regardless of the
presence/absence of the "--no-threads" flag. Since noone seems to
have noticed, I removed the unused async code.
2023-10-18 13:45:23 +03:00
Pēteris Caune
286b8a5a3b
Improve type hints in hc.front.templatetags.hc_extras 2023-10-18 10:08:29 +03:00
Pēteris Caune
c22c8a0a76
Improve markdown markup 2023-10-18 09:17:31 +03:00
Pēteris Caune
e4f233ba30
Sync templates/docs/self_hosted_docker.md and docker/README.md 2023-10-18 09:00:38 +03:00
Pēteris Caune
c123e4d3a9
Add note about SMTPD_PORT in docs
cc: #791
2023-10-18 08:39:22 +03:00
Pēteris Caune
3d5850d2da
Improve type hints, use pydantic for parsing Zulip configurations 2023-10-17 16:58:57 +03:00
Pēteris Caune
bb7632f467
Fix mypy warning 2023-10-17 16:15:37 +03:00
Pēteris Caune
42a137e128
Switch to pydantic for validating Telegram incoming webhooks 2023-10-17 16:10:35 +03:00
Pēteris Caune
86eb2e43e5
Make the "notification" parameter non-optional in Transport.notify()
Its signature was "notification: Notification | None = None".

But callers always specify it, the default value is never used.

So I changed the signature to "notification: Notification".
2023-10-17 14:56:54 +03:00
Pēteris Caune
02888e6db9
Fix sending test notification to a group integration 2023-10-17 11:37:12 +03:00
Pēteris Caune
89aa0a832b
Update uwsgi.ini to allow UWSGI_PROCESSES env var to override it 2023-10-17 10:24:20 +03:00
Pēteris Caune
1553a79205
Update CHANGELOG for v3.0 release 2023-10-16 09:24:18 +03:00
Pēteris Caune
d8ff82bbf1
Improve the event summary for group notifications 2023-10-12 15:05:40 +03:00
Pēteris Caune
37caa94ff5
Improve channel rendering in the group form
* Use the custom-styled checkbox
* Use PNG instead of icon font for channel kind logos
* Show channel's description the same way as in the channels list
  (using a reusable template, templates/front/channel_description.html)
2023-10-12 14:37:00 +03:00
Pēteris Caune
7b03e1f95b
Fix mypy warning 2023-10-12 11:55:47 +03:00
Pēteris Caune
2276fcff60
Rename my_checks -> checks; my_checks_desktop -> checks_table 2023-10-12 11:48:42 +03:00
Pēteris Caune
12114c647e
Fix channel sorting in the "my checks" page to show groups first 2023-10-12 11:43:20 +03:00
Pēteris Caune
51b9bf7ca1
Add testcases for "Add group" and "Edit group" forms 2023-10-07 10:59:57 +03:00
Pēteris Caune
e537a38dd8
Temporarily remove type hints for the view_on_site method 2023-10-06 20:02:00 +03:00
Pēteris Caune
93fcc79926
Improve tests, fix the handling of "no-op" errors 2023-10-06 19:51:08 +03:00
Florian Apolloner
ca10841503
Fix mypy warnings in hc.font.views (#904) 2023-10-06 17:39:20 +03:00
Pēteris Caune
fd54bf87bf
Update changelog 2023-10-06 17:08:43 +03:00
Pēteris Caune
4fc6ff5c26
Tweak CSS in the group form, make sure channel's name is preloaded 2023-10-06 17:06:41 +03:00
Florian Apolloner
7057f6d3a5
Notification groups. Fixes #894 (#901)
* MVP for notification groups.

* Addressed review comments.

* Push notification group to the front.

* Updated icons.

* Reduce code duplication.

* Show groups at the top.

* Add label to group forms.

* Add checkboxes for integration selection.

* CSS for checkboxes.

* Added tests for group notify.
2023-10-06 17:02:41 +03:00
Pēteris Caune
24bad5af52
Tighten type hints in hc.api.admin 2023-10-06 15:33:10 +03:00
Pēteris Caune
fa9db53631
Update admin to use format_html instead of string interpolation 2023-10-06 13:54:15 +03:00
Pēteris Caune
f68b2c01a6
Simplify the counting of updated objects in admin actions 2023-10-06 11:35:32 +03:00
Pēteris Caune
7b1258ceaa
Improve type hints in accounts admin, fix HTML escaping issue
In Project admin, when listing project members, for single-member
projects the owner's email address was being displayed
unescaped. This allowed unescaped amperstand and quote characters
to appear in HTML output.
2023-10-05 16:04:21 +03:00
Pēteris Caune
97830deb29
Improve type hints in test_notify_signal 2023-10-05 15:55:41 +03:00
Pēteris Caune
527f361a9a
Upgrade to Django 4.2.6 2023-10-05 12:45:25 +03:00
Pēteris Caune
fd87cad455
Remove unused imports 2023-10-05 12:44:40 +03:00
Pēteris Caune
d8149cbe84
Add django-stubs-ext to requirements 2023-10-04 16:08:08 +03:00
Pēteris Caune
8fb7d16864
Improve type hints, simplify pagination in Ping admin
Pagination, filtering, and result counting in Ping admin is tricky
as the pings table can contain millions of rows.

We previously used "select reltuples from pg_class" trick to
estimate the total number of rows. This only works on Postgres,
and does not handle WHERE filters.

This commit removes the search box, and changes the pagination
template to allow pagination between pages 1-9 and nothing more.
2023-10-04 16:00:41 +03:00
Pēteris Caune
e065871056
Update package versions 2023-10-04 13:52:32 +03:00
Pēteris Caune
339586e402
Add Python 3.12 to the testing matrix 2023-10-04 13:48:13 +03:00
Pēteris Caune
633e612b59
Increase bottom margin for modal windows to work around Safari issue
cc: #899
2023-10-04 10:22:53 +03:00
Pēteris Caune
5d99c544ee
Increase the precision in hc.lib.date.format_approx_duration
Format durations in one of the following forms:

* "{x} days {y} h"
* "{y} h {z} min"
* "{z} min {w} sec"
2023-10-02 12:50:59 +03:00
Pēteris Caune
d40ce1eaac
Rename DowntimeSummary -> DowntimeRecorder 2023-09-28 09:02:13 +03:00
Pēteris Caune
95b92a9b3b
Fix type warning 2023-09-27 17:47:25 +03:00
Pēteris Caune
2a0ae809a7
Add DowntimeRecord.no_data field 2023-09-27 17:43:18 +03:00
Pēteris Caune
58d7c8cc55
Simplify DowntimeSummary 2023-09-27 17:16:16 +03:00
Pēteris Caune
f7af738c76
Add monthly uptime percentage display in Check Details page
Fixes: #773
2023-09-27 13:44:35 +03:00
Pēteris Caune
db5d8adeb5
Switch from namedtuple to dataclass for mutability 2023-09-27 11:03:58 +03:00
Pēteris Caune
46dbaff2c3
Update Check.downtimes() to return records in descending datetime order
This way we can avoid one sort operation in Check.downtimes()
and one reverse operation in the "details_downtimes.html" template.
2023-09-27 10:42:05 +03:00
Pēteris Caune
f0085933c3
Update Check.downtimes() to return a list of namedtuples
This way it should be easier to add extra fields like uptime
to the returned data structure.
2023-09-27 10:18:52 +03:00
Pēteris Caune
e48d361331
Fix time interval formatting in check details - downtime summary
In hc.lib.date.format_approx_duration, we were calling
timedeltaobj.total_seconds() and basing all calculations off that.
This method returns float, so the final result was "2.0 hours" or
"3.0 days" and similar. We now convert it to int, to get "2 hours",
"3 days" etc.
2023-09-26 10:30:34 +03:00