Linting
This commit is contained in:
parent
d0877f5cdc
commit
34766257b3
|
@ -2,7 +2,6 @@
|
||||||
# Copyright (C) 2017-2019 by BDE ENS Paris-Saclay
|
# Copyright (C) 2017-2019 by BDE ENS Paris-Saclay
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
from django.urls import reverse
|
|
||||||
from django.utils.html import format_html
|
from django.utils.html import format_html
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
from polymorphic.admin import PolymorphicChildModelAdmin, \
|
from polymorphic.admin import PolymorphicChildModelAdmin, \
|
||||||
|
|
|
@ -20,7 +20,7 @@ class Command(BaseCommand):
|
||||||
"Old data structure has been deleted. This script won't work "
|
"Old data structure has been deleted. This script won't work "
|
||||||
"anymore (and is now useless)"))
|
"anymore (and is now useless)"))
|
||||||
|
|
||||||
from media.models import OldCD, OldComic, OldGame, OldManga, OldNovel, \
|
from media.models import OldCD, OldComic, OldGame, OldManga, OldNovel,\
|
||||||
OldReview, OldVinyl
|
OldReview, OldVinyl
|
||||||
|
|
||||||
# Migrate books
|
# Migrate books
|
||||||
|
|
|
@ -97,6 +97,9 @@ class Membership(models.Model):
|
||||||
verbose_name=_('start date'),
|
verbose_name=_('start date'),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return f'{self.user}: {self.date_start} to {self.date_end}'
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = _('membership')
|
verbose_name = _('membership')
|
||||||
verbose_name_plural = _('memberships')
|
verbose_name_plural = _('memberships')
|
||||||
|
@ -202,6 +205,9 @@ class AccessToken(models.Model):
|
||||||
def get_token(cls, request):
|
def get_token(cls, request):
|
||||||
return AccessToken.objects.get(pk=request.session['access_token_id'])
|
return AccessToken.objects.get(pk=request.session['access_token_id'])
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return self.access_token
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = _('access token')
|
verbose_name = _('access token')
|
||||||
verbose_name_plural = _('access tokens')
|
verbose_name_plural = _('access tokens')
|
||||||
|
|
|
@ -20,7 +20,8 @@ class LoginView(RedirectView):
|
||||||
oauth = OAuth()
|
oauth = OAuth()
|
||||||
oauth.register('notekfet')
|
oauth.register('notekfet')
|
||||||
redirect_url = self.request.build_absolute_uri(reverse('users:auth'))
|
redirect_url = self.request.build_absolute_uri(reverse('users:auth'))
|
||||||
return oauth.notekfet.authorize_redirect(self.request, redirect_url).url
|
return oauth.notekfet.authorize_redirect(self.request,
|
||||||
|
redirect_url).url
|
||||||
|
|
||||||
|
|
||||||
class AuthorizeView(RedirectView):
|
class AuthorizeView(RedirectView):
|
||||||
|
|
Loading…
Reference in New Issue