예제 #1
0
 def ready(self):
     from social.strategies.utils import set_current_strategy_getter
     from social.apps.django_app.utils import load_strategy
     # Set strategy loader method to workaround current strategy getter
     # needed on get_user() method on authentication backends when working
     # with Django
     set_current_strategy_getter(load_strategy)
예제 #2
0
파일: views.py 프로젝트: PicUpIt/picup-it
import logging

logger = logging.getLogger(__name__)

from rabbit import get_rabbit_channel

from models import license_choices_files as license_choices
from models import CHOICES_LICENSE

from social.apps.django_app.utils import strategy
from social.actions import do_complete
from django.contrib.auth import login, REDIRECT_FIELD_NAME
from social.strategies.utils import set_current_strategy_getter
from social.apps.django_app.utils import load_strategy

set_current_strategy_getter(load_strategy)

RECOMMENDED_ROWS = settings.RECOMMENDED_ROWS


@login_required
def deerbox_gallery(request, gallery_id):
    """User's gallery edit view.
    """
    try:
        gallery = Gallery.objects.get(user=request.user, id=gallery_id)
    except Gallery.DoesNotExist:
        raise Http404
    pictures_all = Picture.objects.filter(user=request.user, gallery_id=gallery_id)
    gravatar_url = get_gravatar_url(request.user.email)
    galleries = get_user_galleries(request.user, False)
예제 #3
0
from social.strategies.utils import set_current_strategy_getter
from social.apps.flask_me_app.utils import load_strategy

set_current_strategy_getter(load_strategy)