If AuthenticatedHttpRequest lives in the hc.lib.typealias
module then hc.lib.typealias imports User and Profile,
and so needs configured Django settings. Most of the stuff
in hc.lib is intended to work standalone, and not rely on Django.
In requests, "params" is a positional argument for the get function:
requests.get(url, params=None, **kwargs)
So I made params positional here too.
In requests, "data" is a positional argument for the post function:
requests.post(url, data=None, json=None, **kwargs)
So I data positional here too.
This results in changes in other places too:
* curl.post() does not accept `data` as positional arg,
it must now be a keyword argument
* we need asserts and if clauses in a few places to make sure
we are not passing `None` in the arguments to hc.lib.curl.request
Why remove:
* For self-hosters, payment-related features are unused and dead weight
* For SaaS (any would-be Healthchecks.io competitors), the existing
payment handling logic is not very useful either, as it would need to
be heavily modified to match their business model, pricing, chosen
payment gateway
* For the hosted service (Healthchecks.io), the up-to-date billing code
lives in a private fork of this repo. Maintenance is easier if this
repo does not have an older, diverging version of the same
functionality
A few payment-related bits are staying at least for time being:
* the "USE_PAYMENTS" setting
* the hc.payments.models.Subscription model
* tiny stubs for the "Pricing" and "Billing" pages
They are used in various places in the code and templates,
and I think ripping them out in one go would be too disruptive.
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.
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".
* 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)
* 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.
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.
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.
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.
"body" is an obsolete field and kept around for the sake
of very old pings. For all new pings body data goes either
into the "body_raw" binary field (for small bodies)
or in the object storage (for not so small bodies).
So it is not useful to show the body field in the Ping admin.