Pin dependecies & fix errors
This commit is contained in:
parent
28df757ea8
commit
89efdb30fd
11 changed files with 38 additions and 177 deletions
|
|
@ -2,7 +2,7 @@ from django import forms
|
|||
from django.contrib import admin
|
||||
from django.contrib.auth.admin import UserAdmin as DjangoUserAdmin
|
||||
from django.contrib.auth.forms import UserChangeForm
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.utils.translation import gettext as _
|
||||
|
||||
from newsreader.accounts.models import User
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
from django.conf import settings
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
from django.core.mail import send_mail
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.utils.translation import gettext as _
|
||||
|
||||
import requests
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ from django.conf import settings
|
|||
from django.core.mail import send_mail
|
||||
from django.utils import timezone
|
||||
from django.utils.html import format_html, urlize
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.utils.translation import gettext as _
|
||||
|
||||
import pytz
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
from django.utils.encoding import force_text
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.encoding import force_str
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from rest_framework import filters
|
||||
from rest_framework.compat import coreapi, coreschema
|
||||
|
|
@ -25,8 +25,8 @@ class ReadFilter(filters.BaseFilterBackend):
|
|||
required=False,
|
||||
location="query",
|
||||
schema=coreschema.String(
|
||||
title=force_text(self.query_param),
|
||||
description=force_text(_("Wether posts should be read or not")),
|
||||
title=force_str(self.query_param),
|
||||
description=force_str(_("Wether posts should be read or not")),
|
||||
),
|
||||
)
|
||||
]
|
||||
|
|
@ -52,8 +52,8 @@ class SavedFilter(filters.BaseFilterBackend):
|
|||
required=False,
|
||||
location="query",
|
||||
schema=coreschema.String(
|
||||
title=force_text(self.query_param),
|
||||
description=force_text(_("Wether posts should be saved or not")),
|
||||
title=force_str(self.query_param),
|
||||
description=force_str(_("Wether posts should be saved or not")),
|
||||
),
|
||||
)
|
||||
]
|
||||
|
|
|
|||
|
|
@ -3,9 +3,6 @@ from django.contrib import admin
|
|||
from django.contrib.auth.decorators import login_required
|
||||
from django.urls import include, path
|
||||
|
||||
from drf_yasg import openapi
|
||||
from drf_yasg.views import get_schema_view
|
||||
|
||||
from newsreader.accounts.urls import urlpatterns as login_urls
|
||||
from newsreader.news.core.views import NewsView
|
||||
from newsreader.news.urls import endpoints as news_endpoints
|
||||
|
|
@ -14,16 +11,12 @@ from newsreader.news.urls import urlpatterns as news_patterns
|
|||
|
||||
api_patterns = [path("api/", include((news_endpoints, "news")))]
|
||||
|
||||
schema_info = openapi.Info(title="Newsreader API", default_version="v1")
|
||||
schema_view = get_schema_view(schema_info, patterns=api_patterns)
|
||||
|
||||
urlpatterns = [
|
||||
path("", login_required(NewsView.as_view()), name="index"),
|
||||
path("", include((news_patterns, "news"))),
|
||||
path("", include((api_patterns, "api"))),
|
||||
path("accounts/", include((login_urls, "accounts")), name="accounts"),
|
||||
path("admin/", admin.site.urls, name="admin"),
|
||||
path("api/", schema_view.with_ui("swagger"), name="api"),
|
||||
path("api/auth/", include("rest_framework.urls"), name="rest_framework"),
|
||||
]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue