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 ''' ''' customize the info available in context for rendering templates '''
from bookwyrm import models from bookwyrm import models
def site_settings(request): def site_settings(request):# pylint: disable=unused-argument
''' include the custom info about the site ''' ''' include the custom info about the site '''
return { return {
'site': models.SiteSettings.objects.get() 'site': models.SiteSettings.objects.get()

View file

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

View file

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

View file

@ -17,9 +17,6 @@ from bookwyrm.signatures import Signature
@csrf_exempt @csrf_exempt
def inbox(request, username): def inbox(request, username):
''' incoming activitypub events ''' ''' 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: try:
models.User.objects.get(localname=username) models.User.objects.get(localname=username)
except models.User.DoesNotExist: except models.User.DoesNotExist: