mirror of
https://github.com/hellosteadman/bambu-buffer.git
synced 2025-05-05 00:39:52 +00:00
Only post if ENABLED
This commit is contained in:
parent
663fe3d28a
commit
8b0d43b70a
1 changed files with 4 additions and 1 deletions
|
@ -2,7 +2,7 @@ from django.contrib.contenttypes.models import ContentType
|
||||||
from django.contrib.sites.shortcuts import get_current_site
|
from django.contrib.sites.shortcuts import get_current_site
|
||||||
from django.db.models import Model
|
from django.db.models import Model
|
||||||
from bambu_buffer.exceptions import *
|
from bambu_buffer.exceptions import *
|
||||||
from bambu_buffer.settings import POST_URL, TIMEOUT, AUTOPOST_MODELS
|
from bambu_buffer.settings import ENABLED, POST_URL, TIMEOUT, AUTOPOST_MODELS
|
||||||
from datetime import datetime, date
|
from datetime import datetime, date
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
import requests
|
import requests
|
||||||
|
@ -29,6 +29,9 @@ class BufferThread(Thread):
|
||||||
log.error(response.json())
|
log.error(response.json())
|
||||||
|
|
||||||
def post(item, author, **kwargs):
|
def post(item, author, **kwargs):
|
||||||
|
if not ENABLED:
|
||||||
|
return
|
||||||
|
|
||||||
from bambu_buffer.models import BufferToken, BufferProfile, BufferedItem
|
from bambu_buffer.models import BufferToken, BufferProfile, BufferedItem
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue