Exemple #1
0
from bedrock.mozorg.credits import CreditsFile
from bedrock.mozorg.forums import ForumsFile
from bedrock.mozorg.models import ContributorActivity, TwitterCache
from bedrock.mozorg.util import (
    fxa_concert_rsvp,
    get_fxa_oauth_token,
    get_fxa_profile_email,
    HttpResponseJSON
)
from bedrock.newsletter.forms import NewsletterFooterForm
from bedrock.pocketfeed.models import PocketArticle
from bedrock.wordpress.views import BlogPostsView
from lib import l10n_utils
from lib.l10n_utils.dotlang import lang_file_is_active

credits_file = CreditsFile('credits')
forums_file = ForumsFile('forums')

TECH_BLOG_SLUGS = ['hacks', 'cd', 'futurereleases']


def csrf_failure(request, reason=''):
    template_vars = {'reason': reason}
    return l10n_utils.render(request, 'mozorg/csrf-failure.html', template_vars,
                             status=403)


@xframe_allow
def hacks_newsletter(request):
    return l10n_utils.render(request,
                             'mozorg/newsletter/hacks.mozilla.org.html')
Exemple #2
0
from commonware.decorators import xframe_allow
from product_details import product_details
from sentry_sdk import capture_exception

from bedrock.base.waffle import switch
from bedrock.contentcards.models import get_page_content_cards
from bedrock.contentful.api import ContentfulPage
from bedrock.contentful.models import ContentfulEntry
from bedrock.mozorg.credits import CreditsFile
from bedrock.mozorg.models import WebvisionDoc
from bedrock.pocketfeed.models import PocketArticle
from lib import l10n_utils
from lib.l10n_utils import L10nTemplateView, RequireSafeMixin

credits_file = CreditsFile("credits")
TECH_BLOG_SLUGS = ["hacks", "cd", "futurereleases"]


def csrf_failure(request, reason=""):
    template_vars = {"reason": reason}
    return l10n_utils.render(request,
                             "mozorg/csrf-failure.html",
                             template_vars,
                             status=403)


@xframe_allow
def hacks_newsletter(request):
    return l10n_utils.render(request,
                             "mozorg/newsletter/hacks.mozilla.org.html")