from django.contrib.auth.models import User
from django.contrib.auth.backends import ModelBackend
import requests
+from django.conf import settings
class EmailBackend(ModelBackend):
def fetch_fortnox(self):
""" Fetch all active customers from Fortnox API. Return as dict keyed on email."""
res = None
customers = {}
- headers = {"Access-Token":FORTNOX_Access_Token,
- "Client-Secret":FORTNOX_Client_Secret,
+ headers = {"Access-Token":settings.FORTNOX_ACCESS_TOKEN,
+ "Client-Secret":settings.FORTNOX_CLIENT_SECRET,
"Content-Type":"application/json",
"Accept":"application/json" }