From 30c9110271ea0997730be967abaa374c76cce5ca Mon Sep 17 00:00:00 2001
From: Dominik George <dominik.george@teckids.org>
Date: Sun, 1 Dec 2019 01:10:56 +0100
Subject: [PATCH] Make 2FA method packages non-optional. Closes #110.

---
 biscuit/core/settings.py | 4 +---
 pyproject.toml           | 6 +-----
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/biscuit/core/settings.py b/biscuit/core/settings.py
index 78c56b8f3..449d34836 100644
--- a/biscuit/core/settings.py
+++ b/biscuit/core/settings.py
@@ -69,6 +69,7 @@ INSTALLED_APPS = [
     'django_otp.plugins.otp_totp',
     'django_otp.plugins.otp_static',
     'django_otp',
+    'otp_yubikey',
     'biscuit.core',
     'impersonate',
     'two_factor'
@@ -324,9 +325,6 @@ ANONYMIZE_ENABLED = _settings.get('maintenance.anonymisable', True)
 
 LOGIN_URL = 'two_factor:login'
 
-if _settings.get('2fa.yubikey.enabled', False):
-    INSTALLED_APPS.insert(INSTALLED_APPS.index('two_factor')+1, 'otp_yubikey')
-
 if _settings.get('2fa.call.enabled', False):
     TWO_FACTOR_CALL_GATEWAY = 'two_factor.gateways.twilio.gateway.Twilio'
 
diff --git a/pyproject.toml b/pyproject.toml
index 47cd5dd09..a934b2326 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -50,14 +50,10 @@ django-hattori = "^0.2"
 psycopg2 = "^2.8"
 django_select2 = "^7.1"
 requests = "^2.22"
-django-two-factor-auth = "^1.9"
-django-otp-yubikey = { version = '^0.5.2', optional = true }
-twilio = { version = "^6.33", optional = true }
+django-two-factor-auth = { version = "^1.9", extras = [ "YubiKey", "phonenumbers", "Call", "SMS" ] }
 
 [tool.poetry.extras]
 ldap = ["django-auth-ldap"]
-2fa-twilio = ["twilio"]
-2fa-yubikey = ["django-otp-yubikey"]
 
 [tool.poetry.dev-dependencies]
 sphinx = "^2.1"
-- 
GitLab