Self hosted FLOSS fitness/workout, nutrition and weight tracker
Issue #117 - Make captcha usage configurable
matheus5ae572ebef65
diff --git a/wger/core/views/user.py b/wger/core/views/user.pyindex 389e7ab5b..60b9abef7 100644--- a/wger/core/views/user.py+++ b/wger/core/views/user.py@@ -50,7 +50,7 @@ from wger.manager.models import Workoutfrom wger.nutrition.models import NutritionPlanfrom wger.config.models import GymConfigfrom wger.weight.models import WeightEntry-+from wger.settings_global import *logger = logging.getLogger('wger.custom')@@ -189,6 +189,10 @@ def registration(request):is_app = check_request_amazon(request) or check_request_android(request)FormClass = RegistrationFormNoCaptcha if is_app else RegistrationForm+ # Don't show captcha if the global parameter is false+ if WGER_SETTINGS['USE_RECAPTCHA'] == False:+ FormClass = RegistrationFormNoCaptcha+# Redirect regular users, in case they reached the registration pageif request.user.is_authenticated() and not request.user.userprofile.is_temporary:return HttpResponseRedirect(reverse('core:dashboard'))diff --git a/wger/settings_global.py b/wger/settings_global.pyindex a7207ab23..cc2dec94d 100644--- a/wger/settings_global.py+++ b/wger/settings_global.py@@ -328,3 +328,7 @@ REST_FRAMEWORK = {#CORS_ORIGIN_ALLOW_ALL = TrueCORS_URLS_REGEX = r'^/api/.*$'++WGER_SETTINGS = {+ 'USE_RECAPTCHA': True+}\ No newline at end of file