disable some warnings

This commit is contained in:
Mouse Reeve 2020-12-12 18:13:00 -08:00
parent 1e01e76ac2
commit 2b3daa0227
4 changed files with 4 additions and 6 deletions

View file

@ -1,7 +1,7 @@
''' customize the info available in context for rendering templates '''
from bookwyrm import models
def site_settings(request):
def site_settings(request):# pylint: disable=unused-argument
''' include the custom info about the site '''
return {
'site': models.SiteSettings.objects.get()

View file

@ -30,7 +30,7 @@ class CustomForm(ModelForm):
visible.field.widget.attrs['rows'] = None
visible.field.widget.attrs['class'] = css_classes[input_type]
# pylint: disable=missing-class-docstring
class LoginForm(CustomForm):
class Meta:
model = models.User
@ -131,6 +131,7 @@ class ImportForm(forms.Form):
class ExpiryWidget(widgets.Select):
def value_from_datadict(self, data, files, name):
''' human-readable exiration time buckets '''
selected_string = super().value_from_datadict(data, files, name)
if selected_string == 'day':

View file

@ -53,7 +53,7 @@ def import_data(job_id):
for item in job.items.all():
try:
item.resolve()
except Exception as e:
except Exception as e:# pylint: disable=broad-except
logger.exception(e)
item.fail_reason = 'Error loading book'
item.save()

View file

@ -17,9 +17,6 @@ from bookwyrm.signatures import Signature
@csrf_exempt
def inbox(request, username):
''' incoming activitypub events '''
# TODO: should do some kind of checking if the user accepts
# this action from the sender probably? idk
# but this will just throw a 404 if the user doesn't exist
try:
models.User.objects.get(localname=username)
except models.User.DoesNotExist: