def calendar_links(request):
    if request.user.is_authenticated:
        profile = UserProfile(id=request.user.id)
        custom = profile.settings.get("textual_custom", "ashkenazi")
    else:
        custom = "ashkenazi" # this is default because this is the most complete data set
    return {"calendars": json.dumps(calendars.get_todays_calendar_items(diaspora=request.diaspora, custom=custom))}
def calendar_links(request):
    if request.user.is_authenticated:
        profile = UserProfile(id=request.user.id)
        custom = profile.settings.get("textual_custom", "ashkenazi")
    else:
        custom = "ashkenazi"  # this is default because this is the most complete data set
    return {
        "calendars":
        json.dumps(
            calendars.get_todays_calendar_items(diaspora=request.diaspora,
                                                custom=custom))
    }
Ejemplo n.º 3
0
def calendar_links(request):
    loc = request.META.get("HTTP_CF_IPCOUNTRY", None)
    if not loc:
        try:
            from sefaria.settings import PINNED_IPCOUNTRY
            loc = PINNED_IPCOUNTRY
        except:
            loc = "us"
    diaspora = False if loc in ("il", "IL", "Il") else True
    return {"calendars": json.dumps(calendars.get_todays_calendar_items(diaspora=diaspora))}

    """
def calendar_links(request):
    return {
        "calendars":
        json.dumps(
            calendars.get_todays_calendar_items(diaspora=request.diaspora))
    }