Permalink
Browse files

merged master onto branch

  • Loading branch information...
2 parents d23fdc9 + 810e9ac commit bea16e823e156911fe6b6385cb0cc6dd39afa6e6 @ozten committed May 22, 2010
Showing with 26 additions and 13 deletions.
  1. +6 −2 cron/feeder.py
  2. +3 −1 lifestream/views.py
  3. +7 −5 patchouli_auth/views.py
  4. +5 −3 streamManager/views.py
  5. +5 −2 templates/generic/entry.html
View
8 cron/feeder.py
@@ -14,6 +14,7 @@
import time
from django.db import IntegrityError
+import django.utils.encoding
import django.utils.hashcompat as hashcompat
import feedparser
import jsonpickle
@@ -57,7 +58,9 @@ def cron_fetch_feeds():
if 'guid' in entry:
entry_guid = entry.guid
else:
- entry_guid = hashcompat.md5_constructor(json_entry).hexdigest()
+ entry_guid = hashcompat.md5_constructor(
+ django.utils.encoding.smart_str(
+ json_entry)).hexdigest()
yr, mon, d, hr, min, sec = entry.updated_parsed[:-3]
last_publication = datetime.datetime(yr, mon, d, hr, min, sec)
new_entry = lifestream.models.Entry(feed=feed, guid=entry_guid, raw=json_entry,
@@ -70,4 +73,5 @@ def cron_fetch_feeds():
log.info("Finished run in %f seconds" % (time.time() - start))
return 'Finished importing %d items' % new_entry_count
-cron_fetch_feeds()
+if __name__ == '__main__':
+ cron_fetch_feeds()
View
4 lifestream/views.py
@@ -5,6 +5,7 @@
import jsonpickle
import simplejson as json
+import django.utils.encoding
import django.template
import django.template.loaders
import django.http
@@ -108,7 +109,8 @@ def renderProfile(request, user, plugins):
sources = [{'title': s.title, 'url':s.url} for s in sourcesResults]
# avatar
- gravatarHash = hashlib.md5(user.email).hexdigest()
+ gravatarHash = hashlib.md5(
+ django.utils.encoding.smart_str(user.email)).hexdigest()
avatar_url = "http://www.gravatar.com/avatar/%s.jpg?d=monsterid&s=80" % gravatarHash
show_fn = False
View
12 patchouli_auth/views.py
@@ -4,12 +4,11 @@
import django.http
from django.shortcuts import render_to_response
+import django.utils.encoding
from django.contrib.auth import logout
from django.contrib.auth.decorators import login_required
-
-
import lifestream.models
import patchouli_auth.models
import patchouli_auth.preferences
@@ -46,7 +45,8 @@ def profile(request, username):
else:
publishEmailFlag = ''
- gravatarHash = hashlib.md5(request.user.email).hexdigest()
+ gravatarHash = hashlib.md5(
+ django.utils.encoding.smart_str(request.user.email)).hexdigest()
avatar_url = "http://www.gravatar.com/avatar/%s.jpg?d=monsterid&s=80" % gravatarHash
return render_to_response('index.html',
@@ -105,7 +105,8 @@ def confirm_profile(request):
else:
publishEmailFlag = ''
- gravatarHash = hashlib.md5(request.user.email).hexdigest()
+ gravatarHash = hashlib.md5(
+ django.utils.encoding.smart_str(request.user.email)).hexdigest()
avatar_url = "http://www.gravatar.com/avatar/%s.jpg?d=monsterid&s=80" % gravatarHash
return render_to_response('index.html',
@@ -120,7 +121,8 @@ def confirm_profile(request):
},
context_instance=django.template.RequestContext(request))
def gravatar(request, email):
- gravatarHash = hashlib.md5(email).hexdigest()
+ gravatarHash = hashlib.md5(
+ django.utils.encoding.smart_str(email)).hexdigest()
return django.http.HttpResponse("http://www.gravatar.com/avatar/%s.jpg?d=monsterid&s=80" % gravatarHash)
import django.contrib.auth.views
View
8 streamManager/views.py
@@ -3,10 +3,11 @@
import simplejson as json
-import django.utils.hashcompat as hashcompat
+import django.http
import django.template
import django.template.loaders
-import django.http
+import django.utils.hashcompat as hashcompat
+import django.utils.encoding
from django.shortcuts import render_to_response
from django.shortcuts import get_object_or_404
@@ -115,7 +116,8 @@ def urls(request, username):
if 'POST' == request.method:
# url_hash is 'exclude' aka editable=False, so we have to create a model
# and set the url_hash, in order to get the data into the db
- feed_url_hash = hashcompat.md5_constructor(request.POST['url']).hexdigest()
+ feed_url_hash = hashcompat.md5_constructor(
+ django.utils.encoding.smart_str(request.POST['url'])).hexdigest()
params = request.POST.copy()
#params['streams'] = []
View
7 templates/generic/entry.html
@@ -15,10 +15,13 @@
{% endif %}
<h3>{{title}}</h3>
{{ entry|safe }}
- <a class="permalink" href="{{link}}">#</a>
+ <div class="tag-area">
<ul class="tags">
{% for tag in tags %}
<li>{{tag.tag}}</li>
{% endfor %}
- </ul><hr />
+ </ul>
+ </div>
+ <a class="permalink" href="{{link}}">#</a>
+ <hr />
</div>

0 comments on commit bea16e8

Please sign in to comment.