Merge lp:~fo0bar/turku/turku-api-focal into lp:turku/turku-api

Proposed by Ryan Finnie
Status: Merged
Approved by: Joel Sing
Approved revision: 63
Merged at revision: 63
Proposed branch: lp:~fo0bar/turku/turku-api-focal
Merge into: lp:turku/turku-api
Diff against target: 115 lines (+17/-10)
4 files modified
turku_api/admin.py (+4/-1)
turku_api/models.py (+6/-6)
turku_api/settings.py (+2/-1)
turku_api/urls.py (+5/-2)
To merge this branch: bzr merge lp:~fo0bar/turku/turku-api-focal
Reviewer Review Type Date Requested Status
Joel Sing (community) +1 Approve
Review via email: mp+382102@code.launchpad.net

Commit message

Add compatibility for Django 2.2 (Ubuntu focal)

Description of the change

- reverse/reverse_lazy changed from django.core.urlresolvers to
  django.urls
- MIDDLEWARE_CLASSES changed to MIDDLEWARE
- Model ForeignKey on_delete=models.CASCADE changed from implicit to
  explicit

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
Joel Sing (jsing) wrote :

LGTM, thanks.

review: Approve (+1)
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 63

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'turku_api/admin.py'
--- turku_api/admin.py 2020-03-24 23:07:22 +0000
+++ turku_api/admin.py 2020-04-11 21:24:06 +0000
@@ -20,7 +20,10 @@
20from django.utils.html import format_html20from django.utils.html import format_html
21from django.utils import timezone21from django.utils import timezone
22from django.contrib.humanize.templatetags.humanize import naturaltime22from django.contrib.humanize.templatetags.humanize import naturaltime
23from django.core.urlresolvers import reverse23try:
24 from django.urls import reverse # 1.10+
25except ModuleNotFoundError:
26 from django.core.urlresolvers import reverse # pre-1.10
24import datetime27import datetime
2528
2629
2730
=== modified file 'turku_api/models.py'
--- turku_api/models.py 2020-03-24 23:07:22 +0000
+++ turku_api/models.py 2020-04-11 21:24:06 +0000
@@ -172,7 +172,7 @@
172 help_text='Available disk space of this storage unit\'s storage directories, in MiB.',172 help_text='Available disk space of this storage unit\'s storage directories, in MiB.',
173 )173 )
174 auth = models.ForeignKey(174 auth = models.ForeignKey(
175 Auth, validators=[validate_storage_auth],175 Auth, validators=[validate_storage_auth], on_delete=models.CASCADE,
176 help_text='Storage auth used to register this storage unit.',176 help_text='Storage auth used to register this storage unit.',
177 )177 )
178 active = models.BooleanField(178 active = models.BooleanField(
@@ -248,11 +248,11 @@
248 help_text='SSH public key of this machine\'s agent.',248 help_text='SSH public key of this machine\'s agent.',
249 )249 )
250 auth = models.ForeignKey(250 auth = models.ForeignKey(
251 Auth, validators=[validate_machine_auth],251 Auth, validators=[validate_machine_auth], on_delete=models.CASCADE,
252 help_text='Machine auth used to register this machine.',252 help_text='Machine auth used to register this machine.',
253 )253 )
254 storage = models.ForeignKey(254 storage = models.ForeignKey(
255 Storage,255 Storage, on_delete=models.CASCADE,
256 help_text='Storage unit this machine is assigned to.',256 help_text='Storage unit this machine is assigned to.',
257 )257 )
258 active = models.BooleanField(258 active = models.BooleanField(
@@ -303,7 +303,7 @@
303 help_text='Computer-readable source name identifier.',303 help_text='Computer-readable source name identifier.',
304 )304 )
305 machine = models.ForeignKey(305 machine = models.ForeignKey(
306 Machine,306 Machine, on_delete=models.CASCADE,
307 help_text='Machine this source belongs to.',307 help_text='Machine this source belongs to.',
308 )308 )
309 comment = models.CharField(309 comment = models.CharField(
@@ -400,7 +400,7 @@
400class BackupLog(models.Model):400class BackupLog(models.Model):
401 id = UuidPrimaryKeyField()401 id = UuidPrimaryKeyField()
402 source = models.ForeignKey(402 source = models.ForeignKey(
403 Source,403 Source, on_delete=models.CASCADE,
404 help_text='Source this log entry belongs to.',404 help_text='Source this log entry belongs to.',
405 )405 )
406 date = models.DateTimeField(406 date = models.DateTimeField(
@@ -408,7 +408,7 @@
408 help_text='Date/time this log entry was received/processed.',408 help_text='Date/time this log entry was received/processed.',
409 )409 )
410 storage = models.ForeignKey(410 storage = models.ForeignKey(
411 Storage, blank=True, null=True,411 Storage, blank=True, null=True, on_delete=models.CASCADE,
412 help_text='Storage unit this backup occurred on.',412 help_text='Storage unit this backup occurred on.',
413 )413 )
414 success = models.BooleanField(414 success = models.BooleanField(
415415
=== modified file 'turku_api/settings.py'
--- turku_api/settings.py 2020-03-24 23:07:22 +0000
+++ turku_api/settings.py 2020-04-11 21:24:06 +0000
@@ -31,7 +31,7 @@
31 'django.contrib.staticfiles',31 'django.contrib.staticfiles',
32 'turku_api',32 'turku_api',
33)33)
34MIDDLEWARE_CLASSES = (34MIDDLEWARE = (
35 'django.contrib.sessions.middleware.SessionMiddleware',35 'django.contrib.sessions.middleware.SessionMiddleware',
36 'django.middleware.common.CommonMiddleware',36 'django.middleware.common.CommonMiddleware',
37 'django.middleware.csrf.CsrfViewMiddleware',37 'django.middleware.csrf.CsrfViewMiddleware',
@@ -39,6 +39,7 @@
39 'django.contrib.messages.middleware.MessageMiddleware',39 'django.contrib.messages.middleware.MessageMiddleware',
40 'django.middleware.clickjacking.XFrameOptionsMiddleware',40 'django.middleware.clickjacking.XFrameOptionsMiddleware',
41)41)
42MIDDLEWARE_CLASSES = MIDDLEWARE # pre-1.10
42ROOT_URLCONF = 'turku_api.urls'43ROOT_URLCONF = 'turku_api.urls'
43WSGI_APPLICATION = 'turku_api.wsgi.application'44WSGI_APPLICATION = 'turku_api.wsgi.application'
44LANGUAGE_CODE = 'en-us'45LANGUAGE_CODE = 'en-us'
4546
=== modified file 'turku_api/urls.py'
--- turku_api/urls.py 2020-03-24 21:50:17 +0000
+++ turku_api/urls.py 2020-04-11 21:24:06 +0000
@@ -15,7 +15,10 @@
15# <http://www.gnu.org/licenses/>.15# <http://www.gnu.org/licenses/>.
1616
17from django.conf.urls import include, url17from django.conf.urls import include, url
18from django.core.urlresolvers import reverse_lazy18try:
19 from django.urls import reverse_lazy # 1.10+
20except ModuleNotFoundError:
21 from django.core.urlresolvers import reverse_lazy # pre-1.10
19from django.views.generic.base import RedirectView22from django.views.generic.base import RedirectView
20from turku_api import views23from turku_api import views
21from django.contrib import admin24from django.contrib import admin
@@ -32,7 +35,7 @@
32 url(r'^v1/storage_ping_checkin$', views.storage_ping_checkin, name='storage_ping_checkin'),35 url(r'^v1/storage_ping_checkin$', views.storage_ping_checkin, name='storage_ping_checkin'),
33 url(r'^v1/storage_ping_source_update$', views.storage_ping_source_update, name='storage_ping_source_update'),36 url(r'^v1/storage_ping_source_update$', views.storage_ping_source_update, name='storage_ping_source_update'),
34 url(r'^v1/storage_update_config$', views.storage_update_config, name='storage_update_config'),37 url(r'^v1/storage_update_config$', views.storage_update_config, name='storage_update_config'),
35 url(r'^admin/', include(admin.site.urls)),38 url(r'^admin/', admin.site.urls),
36]39]
3740
38try:41try:

Subscribers

People subscribed via source and target branches

to all changes: