From 6422710d756f21201737623ee51d61431cd4e0c9 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Mon, 2 Jul 2012 13:39:39 +0200 Subject: [PATCH 1/1] fix flickr url regex --- apps/cover/forms.py | 2 +- apps/cover/templates/cover/flickr.html | 18 ------------------ 2 files changed, 1 insertion(+), 19 deletions(-) delete mode 100644 apps/cover/templates/cover/flickr.html diff --git a/apps/cover/forms.py b/apps/cover/forms.py index fab0bb62..fdd43048 100755 --- a/apps/cover/forms.py +++ b/apps/cover/forms.py @@ -38,7 +38,7 @@ class FlickrForm(forms.Form): def clean_source_url(self): url = self.cleaned_data['source_url'] - m = re.match(r'(https?://)?(www.)?flickr.com/photos/(?P[^/]+)/(?P\d+)', url) + m = re.match(r'(https?://)?(www\.|secure\.)?flickr\.com/photos/(?P[^/]+)/(?P\d+)', url) if not m: raise forms.ValidationError("It doesn't look like Flickr URL.") author_slug, img_id = m.group('author'), m.group('img') diff --git a/apps/cover/templates/cover/flickr.html b/apps/cover/templates/cover/flickr.html deleted file mode 100644 index fcff1c5c..00000000 --- a/apps/cover/templates/cover/flickr.html +++ /dev/null @@ -1,18 +0,0 @@ -{% extends "catalogue/base.html" %} - - -{% block content %} -

Flickr

- -
-{% csrf_token %} -URL: - -
- - -{% endblock %} -- 2.20.1