Browse Source

Upgrade Django version to 3.2

pull/504/head
Pēteris Caune 4 years ago
parent
commit
78652b5659
No known key found for this signature in database GPG Key ID: E28D7679E9A9EDE2
5 changed files with 6 additions and 9 deletions
  1. +1
    -0
      CHANGELOG.md
  2. +3
    -6
      hc/api/admin.py
  3. +0
    -2
      hc/payments/admin.py
  4. +1
    -0
      hc/settings.py
  5. +1
    -1
      requirements.txt

+ 1
- 0
CHANGELOG.md View File

@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file.
## v1.20.0 - Unreleased
## Improvements
- Django 3.2
- Rename VictorOps -> Splunk On-Call
- Implement email body decoding in the "Ping Details" dialog
- Add a "Subject" field in the "Ping Details" dialog


+ 3
- 6
hc/api/admin.py View File

@ -55,6 +55,7 @@ class ChecksAdmin(admin.ModelAdmin):
return s
@admin.display(description="Schedule")
def timeout_schedule(self, obj):
if obj.kind == "simple":
return format_duration(obj.timeout)
@ -63,8 +64,7 @@ class ChecksAdmin(admin.ModelAdmin):
else:
return "Unknown"
timeout_schedule.short_description = "Schedule"
@admin.action(description="Send Alert")
def send_alert(self, request, qs):
for check in qs:
for channel in check.channel_set.all():
@ -72,8 +72,6 @@ class ChecksAdmin(admin.ModelAdmin):
self.message_user(request, "%d alert(s) sent" % qs.count())
send_alert.short_description = "Send Alert"
class SchemeListFilter(admin.SimpleListFilter):
title = "Scheme"
@ -201,11 +199,10 @@ class ChannelsAdmin(admin.ModelAdmin):
return f'<span class="ic-{ obj.kind }"></span> &nbsp; {obj.kind}{note}'
@admin.display(boolean=True)
def ok(self, obj):
return False if obj.last_error else True
ok.boolean = True
@admin.register(Notification)
class NotificationsAdmin(admin.ModelAdmin):


+ 0
- 2
hc/payments/admin.py View File

@ -42,8 +42,6 @@ class SubsAdmin(admin.ModelAdmin):
return ""
profile.allow_tags = True
def cancel(self, request, qs):
for sub in qs.all():
sub.cancel()


+ 1
- 0
hc/settings.py View File

@ -106,6 +106,7 @@ TEST_RUNNER = "hc.api.tests.CustomRunner"
# Default database engine is SQLite. So one can just check out code,
# install requirements.txt and do manage.py runserver and it works
DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",


+ 1
- 1
requirements.txt View File

@ -1,6 +1,6 @@
cron-descriptor==1.2.24
croniter==1.0.8
Django==3.1.7
Django==3.2
django-compressor==2.4
fido2==0.9.1
psycopg2==2.8.6


Loading…
Cancel
Save