Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Let Django resolve URL when getting from settings #905

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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