Lots of pylint and pep8 fixes in nearly every file.

This commit is contained in:
Isaac Bythewood
2012-05-12 00:27:02 +00:00
parent 326e7a2e33
commit 8e8bcdfb49
10 changed files with 23 additions and 14 deletions

View File

@@ -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)