Permalink
Browse files

fix flickr url regex

  • Loading branch information...
rczajka committed Jul 2, 2012
1 parent f56133b commit 6422710d756f21201737623ee51d61431cd4e0c9
Showing with 1 addition and 19 deletions.
  1. +1 −1 apps/cover/forms.py
  2. +0 −18 apps/cover/templates/cover/flickr.html
View
@@ -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')
@@ -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 %}

0 comments on commit 6422710

Please sign in to comment.