mirror of
https://github.com/pinry/pinry.git
synced 2026-01-29 18:49:27 +01:00
Updates to support Python 3
This commit is contained in:
@@ -33,7 +33,6 @@ class PinryAuthorization(DjangoAuthorization):
|
||||
if klass is False:
|
||||
raise Unauthorized("You are not allowed to access that resource.")
|
||||
|
||||
print dir(klass._meta)
|
||||
permission = '%s.delete_%s' % (klass._meta.app_label, klass._meta.model_name)
|
||||
|
||||
if not bundle.request.user.has_perm(permission, bundle.obj):
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
import requests
|
||||
from cStringIO import StringIO
|
||||
|
||||
try:
|
||||
from cStringIO import StringIO
|
||||
except ImportError: # Python 3 support
|
||||
from io import StringIO
|
||||
|
||||
from django.conf import settings
|
||||
from django.core.files.uploadedfile import InMemoryUploadedFile
|
||||
|
||||
@@ -6,7 +6,7 @@ from django.contrib.auth.models import User as BaseUser
|
||||
class User(BaseUser):
|
||||
@property
|
||||
def gravatar(self):
|
||||
return hashlib.md5(self.email).hexdigest()
|
||||
return hashlib.md5(self.email.encode('utf-8')).hexdigest()
|
||||
|
||||
class Meta:
|
||||
proxy = True
|
||||
proxy = True
|
||||
|
||||
Reference in New Issue
Block a user