From: Radek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Date: Mon, 2 Jul 2012 11:39:39 +0000 (+0200)
Subject: fix flickr url regex
X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/6422710d756f21201737623ee51d61431cd4e0c9

fix flickr url regex
---

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<author>[^/]+)/(?P<img>\d+)', url)
+        m = re.match(r'(https?://)?(www\.|secure\.)?flickr\.com/photos/(?P<author>[^/]+)/(?P<img>\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 %}
-<h1>Flickr</h1>
-
-<form method="post">
-{% csrf_token %}
-URL: <input size="50" placeholder="np. http://www.flickr.com/photos/abcdef/1234567890" name="flickr_url" value="{{ url }}"/>
-<input type="submit" value="Generuj metadane" />
-</form>
-
-<textarea style="width:100%" rows="5">
-&lt;dc:relation.coverImage.url xmlns:dc="http://purl.org/dc/elements/1.1/">{{ image_url }}&lt;/dc:relation.coverImage.url>
-&lt;dc:relation.coverImage.attribution xmlns:dc="http://purl.org/dc/elements/1.1/">{{ author }}@Flickr, {{ license_name }}&lt;/dc:relation.coverImage.attribution>
-&lt;dc:relation.coverImage.source xmlns:dc="http://purl.org/dc/elements/1.1/">{{ url }}&lt;/dc:relation.coverImage.source>
-</textarea>
-{% endblock %}