diff -uNr debian.orig/changelog debian/changelog --- debian.orig/changelog 2018-02-27 15:21:57.000000000 +0100 +++ debian/changelog 2019-08-30 10:44:02.000000000 +0200 @@ -1,3 +1,9 @@ +django-piston3 (0.3~rc2-3ubuntu5.1) bionic; urgency=medium + + * debian/patches/nonce-index.patch: Add index to Nonce model (LP: #1842043) + + -- Alberto Donato Fri, 30 Aug 2019 08:44:02 +0000 + django-piston3 (0.3~rc2-3ubuntu5) bionic; urgency=medium * d/p/receive-request-lp1750998.patch: Re-enable. diff -uNr debian.orig/patches/nonce-index.patch debian/patches/nonce-index.patch --- debian.orig/patches/nonce-index.patch 1970-01-01 01:00:00.000000000 +0100 +++ debian/patches/nonce-index.patch 2019-08-30 10:43:55.000000000 +0200 @@ -0,0 +1,57 @@ +Description: add a unique index to the Nonce model to speed up nonce search +Origin: upstream, https://git.launchpad.net/django-piston3/commit/?id=8727af91727caffa8c012aad46711c880bf7b992 +Author: Alberto Donato +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/django-piston3/+bug/1842043 +Forwarded: non-needed +Last-Update: 2019-08-30 +Index: django-piston3/piston/models.py +=================================================================== +--- django-piston3.orig/piston/models.py 2019-08-30 10:26:27.772857060 +0200 ++++ django-piston3/piston/models.py 2019-08-30 10:27:00.709109736 +0200 +@@ -48,6 +48,11 @@ + def __unicode__(self): + return u"Nonce %s for %s" % (self.key, self.consumer_key) + ++ class Meta: ++ # This is mostly useful to speed up Nonces lookups, as the table can ++ # grow quite large and full scans are expensive ++ unique_together = [['token_key', 'consumer_key', 'key']] ++ + + class Consumer(models.Model): + name = models.CharField(max_length=255) +Index: django-piston3/requirements.txt +=================================================================== +--- django-piston3.orig/requirements.txt 2019-08-30 10:25:22.900359331 +0200 ++++ django-piston3/requirements.txt 2019-08-30 10:27:00.709109736 +0200 +@@ -1,3 +1,3 @@ + six + python-mimeparse +-django >= 1.6 ++django < 2.0 +Index: django-piston3/tests/test_project/apps/testapp/tests.py +=================================================================== +--- django-piston3.orig/tests/test_project/apps/testapp/tests.py 2019-08-30 10:25:22.900359331 +0200 ++++ django-piston3/tests/test_project/apps/testapp/tests.py 2019-08-30 10:27:00.709109736 +0200 +@@ -309,8 +309,8 @@ + content: bar2 + title: foo2 + - comments: +- - {content: test1} +- - {content: test2} ++ - content: test1 ++ - content: test2 + content: test + title: test + """ +Index: django-piston3/tox.ini +=================================================================== +--- django-piston3.orig/tox.ini 2019-08-30 10:25:22.900359331 +0200 ++++ django-piston3/tox.ini 2019-08-30 10:27:08.929172796 +0200 +@@ -1,5 +1,5 @@ + [tox] +-envlist = py27,py33,py34 ++envlist = py27,py36 + + [testenv] + changedir = tests diff -uNr debian.orig/patches/series debian/patches/series --- debian.orig/patches/series 2018-02-27 15:21:57.000000000 +0100 +++ debian/patches/series 2019-08-30 10:43:55.000000000 +0200 @@ -2,3 +2,4 @@ handle-django-1.7-migrations support-django-1.11.patch receive-request-lp1750998.patch +nonce-index.patch