Browse Source

Update DRF and further disable token models from dj-rest-auth

David Burke 4 years ago
parent
commit
3e0c079414
4 changed files with 19 additions and 11 deletions
  1. 1 0
      glitchtip/settings.py
  2. 9 9
      poetry.lock
  3. 2 2
      pyproject.toml
  4. 7 0
      users/utils.py

+ 1 - 0
glitchtip/settings.py

@@ -346,6 +346,7 @@ REST_AUTH_SERIALIZERS = {
 REST_AUTH_REGISTER_SERIALIZERS = {
     "REGISTER_SERIALIZER": "users.serializers.RegisterSerializer",
 }
+REST_AUTH_TOKEN_MODEL = "users.utils.NoopModel"
 REST_AUTH_TOKEN_CREATOR = "users.utils.noop_token_creator"
 
 # By default (False) only the first user may register and create an organization

+ 9 - 9
poetry.lock

@@ -515,22 +515,22 @@ sftp = ["paramiko"]
 
 [[package]]
 name = "djangorestframework"
-version = "3.11.2"
+version = "3.12.1"
 description = "Web APIs for Django, made easy."
 category = "main"
 optional = false
 python-versions = ">=3.5"
 
 [package.dependencies]
-django = ">=1.11"
+django = ">=2.2"
 
 [[package]]
 name = "drf-nested-routers"
-version = "0.91"
+version = "0.92.1"
 description = "Nested resources for the Django Rest Framework"
 category = "main"
 optional = false
-python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
+python-versions = ">=3.5"
 
 [package.dependencies]
 Django = ">=1.11"
@@ -1465,7 +1465,7 @@ testing = ["coverage (>=5.0.3)", "zope.event", "zope.testing"]
 [metadata]
 lock-version = "1.1"
 python-versions = "^3.7"
-content-hash = "cb94a516132b401cbd04fd5f7f9e00401b1c85c2dac4f18f8127d706fe590f5d"
+content-hash = "b8757ca2e2ee8590218ebbea6b4e8b05695cc175473e0a1a63b50bffab4b8dd7"
 
 [metadata.files]
 amqp = [
@@ -1682,12 +1682,12 @@ django-storages = [
     {file = "django_storages-1.10.1-py3-none-any.whl", hash = "sha256:12de8fb2605b9b57bfaf54b075280d7cbb3b3ee1ca4bc9b9add147af87fe3a2c"},
 ]
 djangorestframework = [
-    {file = "djangorestframework-3.11.2-py3-none-any.whl", hash = "sha256:5cc724dc4b076463497837269107e1995b1fbc917468d1b92d188fd1af9ea789"},
-    {file = "djangorestframework-3.11.2.tar.gz", hash = "sha256:a5967b68a04e0d97d10f4df228e30f5a2d82ba63b9d03e1759f84993b7bf1b53"},
+    {file = "djangorestframework-3.12.1-py3-none-any.whl", hash = "sha256:5c5071fcbad6dce16f566d492015c829ddb0df42965d488b878594aabc3aed21"},
+    {file = "djangorestframework-3.12.1.tar.gz", hash = "sha256:d54452aedebb4b650254ca092f9f4f5df947cb1de6ab245d817b08b4f4156249"},
 ]
 drf-nested-routers = [
-    {file = "drf-nested-routers-0.91.tar.gz", hash = "sha256:46e5c3abc15c782cafafd7d75028e8f9121bbc6228e3599bbb48a3daa4585034"},
-    {file = "drf_nested_routers-0.91-py2.py3-none-any.whl", hash = "sha256:60c1e1f5cc801e757d26a8138e61c44419ef800c213c3640c5b6138e77d46762"},
+    {file = "drf-nested-routers-0.92.1.tar.gz", hash = "sha256:e043fc937f94ac462a92d2d9fc9a7e55710a67164b558442adfe9634fc519c3b"},
+    {file = "drf_nested_routers-0.92.1-py2.py3-none-any.whl", hash = "sha256:52be428b046078ed21e9137167035cc2eb8daad036900fd2235ce026306e143a"},
 ]
 drf-yasg = [
     {file = "drf-yasg-1.20.0.tar.gz", hash = "sha256:d50f197c7f02545d0b736df88c6d5cf874f8fea2507ad85ad7de6ae5bf2d9e5a"},

+ 2 - 2
pyproject.toml

@@ -8,7 +8,7 @@ license = "MIT"
 [tool.poetry.dependencies]
 python = "^3.7"
 Django = "^3.1"
-djangorestframework = "~3.11.2"
+djangorestframework = "^3.12.1"
 django-allauth = "^0.43.0"
 django-cors-headers = "^3.2.0"
 django-debug-toolbar = "~3.1.1"
@@ -16,7 +16,7 @@ django-environ = "^0.4.5"
 django-extensions = "^3.0.2"
 django-organizations = "^1.1.2"
 django-storages = "^1.8"
-drf-nested-routers = "^0.91"
+drf-nested-routers = "^0.92.1"
 psycopg2-binary = "^2.8.4"
 uWSGI = "^2.0.18"
 whitenoise = "^5.0.1"

+ 7 - 0
users/utils.py

@@ -12,3 +12,10 @@ def is_user_registration_open() -> bool:
 def noop_token_creator(token_model, user, serializer):
     """ Fake token creator to use sessions instead of tokens """
     return None
+
+
+class NoopModel:
+    """
+    dj-rest-auth doesn't officially support not having a Token model
+    But we can use this nothing class instead
+    """