fix pylint errors

This commit is contained in:
reesporte 2021-08-30 11:47:19 -05:00
parent 6e628fed38
commit 0f481714c0
1 changed files with 5 additions and 6 deletions

View File

@ -1,5 +1,7 @@
""" what are we here for if not for posting """ """ what are we here for if not for posting """
import re import re
from urllib.parse import urlparse
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
from django.core.validators import URLValidator from django.core.validators import URLValidator
from django.core.exceptions import ValidationError from django.core.exceptions import ValidationError
@ -8,10 +10,8 @@ from django.shortcuts import get_object_or_404, redirect
from django.template.response import TemplateResponse from django.template.response import TemplateResponse
from django.utils.decorators import method_decorator from django.utils.decorators import method_decorator
from django.views import View from django.views import View
from markdown import markdown from markdown import markdown
from urllib.parse import urlparse
from bookwyrm import forms, models from bookwyrm import forms, models
from bookwyrm.sanitize_html import InputHtmlParser from bookwyrm.sanitize_html import InputHtmlParser
from bookwyrm.settings import DOMAIN from bookwyrm.settings import DOMAIN
@ -153,7 +153,6 @@ def find_mentions(content):
def format_links(content): def format_links(content):
"""detect and format links""" """detect and format links"""
v = URLValidator()
formatted_content = "" formatted_content = ""
for potential_link in content.split(): for potential_link in content.split():
try: try:
@ -187,8 +186,8 @@ def format_links(content):
def _wrapped(text): def _wrapped(text):
"""check if a line of text is wrapped in parentheses, square brackets or curly brackets. return wrapped status""" """check if a line of text is wrapped in parentheses, square brackets or curly brackets. return wrapped status"""
wrappers = [("(", ")"), ("[", "]"), ("{", "}")] wrappers = [("(", ")"), ("[", "]"), ("{", "}")]
for w in wrappers: for wrapper in wrappers:
if text[0] == w[0] and text[-1] == w[-1]: if text[0] == wrapper[0] and text[-1] == wrapper[-1]:
return True return True
return False return False