Skip to content
This repository
Browse code

merged master onto branch

  • Loading branch information...
commit bea16e823e156911fe6b6385cb0cc6dd39afa6e6 2 parents d23fdc9 + 810e9ac
Austin King authored
8 cron/feeder.py
@@ -14,6 +14,7 @@
14 14 import time
15 15
16 16 from django.db import IntegrityError
  17 +import django.utils.encoding
17 18 import django.utils.hashcompat as hashcompat
18 19 import feedparser
19 20 import jsonpickle
@@ -57,7 +58,9 @@ def cron_fetch_feeds():
57 58 if 'guid' in entry:
58 59 entry_guid = entry.guid
59 60 else:
60   - entry_guid = hashcompat.md5_constructor(json_entry).hexdigest()
  61 + entry_guid = hashcompat.md5_constructor(
  62 + django.utils.encoding.smart_str(
  63 + json_entry)).hexdigest()
61 64 yr, mon, d, hr, min, sec = entry.updated_parsed[:-3]
62 65 last_publication = datetime.datetime(yr, mon, d, hr, min, sec)
63 66 new_entry = lifestream.models.Entry(feed=feed, guid=entry_guid, raw=json_entry,
@@ -70,4 +73,5 @@ def cron_fetch_feeds():
70 73 log.info("Finished run in %f seconds" % (time.time() - start))
71 74 return 'Finished importing %d items' % new_entry_count
72 75
73   -cron_fetch_feeds()
  76 +if __name__ == '__main__':
  77 + cron_fetch_feeds()
4 lifestream/views.py
@@ -5,6 +5,7 @@
5 5 import jsonpickle
6 6 import simplejson as json
7 7
  8 +import django.utils.encoding
8 9 import django.template
9 10 import django.template.loaders
10 11 import django.http
@@ -108,7 +109,8 @@ def renderProfile(request, user, plugins):
108 109 sources = [{'title': s.title, 'url':s.url} for s in sourcesResults]
109 110
110 111 # avatar
111   - gravatarHash = hashlib.md5(user.email).hexdigest()
  112 + gravatarHash = hashlib.md5(
  113 + django.utils.encoding.smart_str(user.email)).hexdigest()
112 114 avatar_url = "http://www.gravatar.com/avatar/%s.jpg?d=monsterid&s=80" % gravatarHash
113 115
114 116 show_fn = False
12 patchouli_auth/views.py
@@ -4,12 +4,11 @@
4 4
5 5 import django.http
6 6 from django.shortcuts import render_to_response
  7 +import django.utils.encoding
7 8
8 9 from django.contrib.auth import logout
9 10 from django.contrib.auth.decorators import login_required
10 11
11   -
12   -
13 12 import lifestream.models
14 13 import patchouli_auth.models
15 14 import patchouli_auth.preferences
@@ -46,7 +45,8 @@ def profile(request, username):
46 45 else:
47 46 publishEmailFlag = ''
48 47
49   - gravatarHash = hashlib.md5(request.user.email).hexdigest()
  48 + gravatarHash = hashlib.md5(
  49 + django.utils.encoding.smart_str(request.user.email)).hexdigest()
50 50 avatar_url = "http://www.gravatar.com/avatar/%s.jpg?d=monsterid&s=80" % gravatarHash
51 51
52 52 return render_to_response('index.html',
@@ -105,7 +105,8 @@ def confirm_profile(request):
105 105 else:
106 106 publishEmailFlag = ''
107 107
108   - gravatarHash = hashlib.md5(request.user.email).hexdigest()
  108 + gravatarHash = hashlib.md5(
  109 + django.utils.encoding.smart_str(request.user.email)).hexdigest()
109 110 avatar_url = "http://www.gravatar.com/avatar/%s.jpg?d=monsterid&s=80" % gravatarHash
110 111
111 112 return render_to_response('index.html',
@@ -120,7 +121,8 @@ def confirm_profile(request):
120 121 },
121 122 context_instance=django.template.RequestContext(request))
122 123 def gravatar(request, email):
123   - gravatarHash = hashlib.md5(email).hexdigest()
  124 + gravatarHash = hashlib.md5(
  125 + django.utils.encoding.smart_str(email)).hexdigest()
124 126 return django.http.HttpResponse("http://www.gravatar.com/avatar/%s.jpg?d=monsterid&s=80" % gravatarHash)
125 127
126 128 import django.contrib.auth.views
8 streamManager/views.py
@@ -3,10 +3,11 @@
3 3
4 4 import simplejson as json
5 5
6   -import django.utils.hashcompat as hashcompat
  6 +import django.http
7 7 import django.template
8 8 import django.template.loaders
9   -import django.http
  9 +import django.utils.hashcompat as hashcompat
  10 +import django.utils.encoding
10 11
11 12 from django.shortcuts import render_to_response
12 13 from django.shortcuts import get_object_or_404
@@ -115,7 +116,8 @@ def urls(request, username):
115 116 if 'POST' == request.method:
116 117 # url_hash is 'exclude' aka editable=False, so we have to create a model
117 118 # and set the url_hash, in order to get the data into the db
118   - feed_url_hash = hashcompat.md5_constructor(request.POST['url']).hexdigest()
  119 + feed_url_hash = hashcompat.md5_constructor(
  120 + django.utils.encoding.smart_str(request.POST['url'])).hexdigest()
119 121 params = request.POST.copy()
120 122 #params['streams'] = []
121 123
7 templates/generic/entry.html
@@ -15,10 +15,13 @@
15 15 {% endif %}
16 16 <h3>{{title}}</h3>
17 17 {{ entry|safe }}
18   - <a class="permalink" href="{{link}}">#</a>
  18 + <div class="tag-area">
19 19 <ul class="tags">
20 20 {% for tag in tags %}
21 21 <li>{{tag.tag}}</li>
22 22 {% endfor %}
23   - </ul><hr />
  23 + </ul>
  24 + </div>
  25 + <a class="permalink" href="{{link}}">#</a>
  26 + <hr />
24 27 </div>

0 comments on commit bea16e8

Please sign in to comment.
Something went wrong with that request. Please try again.