Добавлена проверка на CSRF #17
This commit is contained in:
parent
ca6d0eaa5e
commit
1c6a9fdcc9
@ -4,15 +4,12 @@ from json import JSONEncoder
|
|||||||
import requests
|
import requests
|
||||||
from django.http import HttpRequest
|
from django.http import HttpRequest
|
||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
from django.utils.decorators import method_decorator
|
|
||||||
from django.views import View
|
from django.views import View
|
||||||
from django.views.decorators.csrf import csrf_exempt
|
|
||||||
|
|
||||||
from cms.forms import ArticleForm
|
from cms.forms import ArticleForm
|
||||||
from cms.models import Article
|
from cms.models import Article
|
||||||
|
|
||||||
|
|
||||||
@method_decorator(csrf_exempt, name='dispatch')
|
|
||||||
class ArticleView(View):
|
class ArticleView(View):
|
||||||
def _promote_to_telegram(self, article: Article):
|
def _promote_to_telegram(self, article: Article):
|
||||||
bot_token = os.getenv('TELEGRAM_BOT_TOKEN')
|
bot_token = os.getenv('TELEGRAM_BOT_TOKEN')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user