def get_default_shop(request=None):
    """Returns the default shop.
    """
    from lfs.core.models import Shop
    if request:
        try:
            return request.shop
        except __HOLE__:
            pass

    try:
        shop = Shop.objects.get(pk=1)
    except Shop.DoesNotExist, e:  # No guarantee that our shop will have pk=1 in postgres
        shop = Shop.objects.all()[0]

    if request:
        request.shop = shop

    return shop
dataset/ETHPy150Open diefenbach/django-lfs/lfs/core/utils.py/get_default_shop