Skip to content

Commit

Permalink
Let Django resolve URL when getting from settings
Browse files Browse the repository at this point in the history
  • Loading branch information
webjunkie committed Apr 20, 2016
1 parent 8f8de02 commit 7aec176
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion social/strategies/django_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from django.db.models import Model
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth import authenticate
from django.shortcuts import redirect
from django.shortcuts import redirect, resolve_url
from django.template import TemplateDoesNotExist, RequestContext, loader
from django.utils.encoding import force_text
from django.utils.functional import Promise
Expand Down Expand Up @@ -35,6 +35,8 @@ def get_setting(self, name):
# Force text on URL named settings that are instance of Promise
if name.endswith('_URL') and isinstance(value, Promise):
value = force_text(value)
if name.endswith('_URL'):
return resolve_url(value)
return value

def request_data(self, merge=True):
Expand Down

0 comments on commit 7aec176

Please # to comment.