fix
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Tue, 15 Nov 2011 11:55:22 +0000 (12:55 +0100)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Tue, 15 Nov 2011 11:55:22 +0000 (12:55 +0100)
apps/poetry/models.py
apps/poetry/templates/poetry/poet.html

index 39f3e05..244538a 100644 (file)
@@ -25,9 +25,11 @@ class Poet(models.Model):
     def write(self):
         curdir = os.getcwd()
         os.chdir(os.path.dirname(self.path))
-        text = subprocess.check_output(self.path).decode("utf-8")
+        proc = subprocess.Popen(self.path,
+            stdout=subprocess.PIPE, stderr=subprocess.PIPE)
         os.chdir(curdir)
-        text = text[:1000]
+        stdout, stderr = proc.communicate()
+        text = stdout.decode("utf-8")[:1000]
         slug = get_hash(text)
         title = ''
         if self.first_line_title:
index 053dce5..68ffaad 100644 (file)
@@ -30,7 +30,7 @@
 
 <p>{{ poet.description }}</p>
 
-<p>Kod źródłowy: <strong>{{ poet.url }}</strong></p>
+<p>Kod źródłowy: <a href="{{ poet.url }}">{{ poet.url }}</a></p>
 
 <a class="tworz" href="{% url 'poetry_new' poet.slug %}">Twórz-że!</a>