mirror of
https://github.com/pinry/pinry.git
synced 2025-11-14 09:05:41 +01:00
Lots of pylint and pep8 fixes in nearly every file.
This commit is contained in:
@@ -13,7 +13,8 @@ class PinForm(forms.ModelForm):
|
||||
image_file_types = ['png', 'gif', 'jpeg', 'jpg']
|
||||
file_type = data.split('.')[-1]
|
||||
if file_type.lower() not in image_file_types:
|
||||
raise forms.ValidationError("Requested URL is not an image file. Only images are currently supported.")
|
||||
raise forms.ValidationError("Requested URL is not an image file. "
|
||||
"Only images are currently supported.")
|
||||
|
||||
# Check if pin already exists
|
||||
try:
|
||||
@@ -26,7 +27,9 @@ class PinForm(forms.ModelForm):
|
||||
elif protocol == 'https':
|
||||
opp_data = data.replace('https://', 'http://')
|
||||
else:
|
||||
raise forms.ValidationError("Currently only support HTTP and HTTPS protocols, please be sure you include this in the URL.")
|
||||
raise forms.ValidationError("Currently only support HTTP and "
|
||||
"HTTPS protocols, please be sure "
|
||||
"you include this in the URL.")
|
||||
|
||||
try:
|
||||
Pin.objects.get(url=opp_data)
|
||||
|
||||
Reference in New Issue
Block a user