Self hosted FLOSS fitness/workout, nutrition and weight tracker
Rename the variable to MIN_ACCOUNT_AGE_TO_TRUST
Mohammad Rafigh60dd5eb64d2c
diff --git a/extras/docker/development/settings.py b/extras/docker/development/settings.pyindex e25b70a19..d5c3feb51 100644--- a/extras/docker/development/settings.py+++ b/extras/docker/development/settings.py@@ -94,7 +94,7 @@ DEFAULT_FROM_EMAIL = WGER_SETTINGS['EMAIL_FROM']WGER_SETTINGS["ALLOW_REGISTRATION"] = env.bool("ALLOW_REGISTRATION", True)WGER_SETTINGS["ALLOW_GUEST_USERS"] = env.bool("ALLOW_GUEST_USERS", True)WGER_SETTINGS["ALLOW_UPLOAD_VIDEOS"] = env.bool("ALLOW_UPLOAD_VIDEOS", True)-WGER_SETTINGS["MINIMUM_AGE_TO_TRUST"] = env.int("MINIMUM_AGE_TO_TRUST", 21) # in days+WGER_SETTINGS["MIN_ACCOUNT_AGE_TO_TRUST"] = env.int("MIN_ACCOUNT_AGE_TO_TRUST", 21) # in daysWGER_SETTINGS["EXERCISE_CACHE_TTL"] = env.int("EXERCISE_CACHE_TTL", 3600)diff --git a/wger/core/models/profile.py b/wger/core/models/profile.pyindex e35af5d7e..d3737443e 100644--- a/wger/core/models/profile.py+++ b/wger/core/models/profile.py@@ -202,7 +202,7 @@ by the US Department of Agriculture. It is extremely complete, with aroundreturn Falsedays_since_joined = datetime.date.today() - self.user.date_joined.date()- minimum_account_age = settings.WGER_SETTINGS['MINIMUM_AGE_TO_TRUST']+ minimum_account_age = settings.WGER_SETTINGS['MIN_ACCOUNT_AGE_TO_TRUST']return days_since_joined.days > minimum_account_age and self.email_verifieddiff --git a/wger/core/tests/test_registration.py b/wger/core/tests/test_registration.pyindex 0d63c9b3e..3e0b03422 100644--- a/wger/core/tests/test_registration.py+++ b/wger/core/tests/test_registration.py@@ -46,7 +46,7 @@ class RegistrationTestCase(WgerTestCase):'ALLOW_REGISTRATION': True,'ALLOW_GUEST_USERS': True,'TWITTER': False,- 'MINIMUM_AGE_TO_TRUST': 21,+ 'MIN_ACCOUNT_AGE_TO_TRUST': 21,}):response = self.client.get(reverse('core:user:registration'))@@ -58,7 +58,7 @@ class RegistrationTestCase(WgerTestCase):'ALLOW_REGISTRATION': True,'ALLOW_GUEST_USERS': True,'TWITTER': False,- 'MINIMUM_AGE_TO_TRUST': 21,+ 'MIN_ACCOUNT_AGE_TO_TRUST': 21,}):response = self.client.get(reverse('core:user:registration'))@@ -118,7 +118,7 @@ class RegistrationTestCase(WgerTestCase):'USE_RECAPTCHA': False,'ALLOW_GUEST_USERS': True,'ALLOW_REGISTRATION': False,- 'MINIMUM_AGE_TO_TRUST': 21,+ 'MIN_ACCOUNT_AGE_TO_TRUST': 21,}):diff --git a/wger/core/tests/test_temporary_users.py b/wger/core/tests/test_temporary_users.pyindex fa571ded9..253a14cfb 100644--- a/wger/core/tests/test_temporary_users.py+++ b/wger/core/tests/test_temporary_users.py@@ -64,7 +64,7 @@ class DemoUserTestCase(WgerTestCase):'ALLOW_REGISTRATION': True,'ALLOW_GUEST_USERS': False,'TWITTER': False,- 'MINIMUM_AGE_TO_TRUST': 21,+ 'MIN_ACCOUNT_AGE_TO_TRUST': 21,}):self.assertEqual(self.count_temp_users(), 1)diff --git a/wger/settings_global.py b/wger/settings_global.pyindex 0555b4f2c..9d95a95da 100644--- a/wger/settings_global.py+++ b/wger/settings_global.py@@ -483,7 +483,7 @@ WGER_SETTINGS = {'ALLOW_GUEST_USERS': True,'ALLOW_REGISTRATION': True,'ALLOW_UPLOAD_VIDEOS': False,- 'MINIMUM_AGE_TO_TRUST': 21,+ 'MIN_ACCOUNT_AGE_TO_TRUST': 21,'EMAIL_FROM': 'wger Workout Manager <[email protected]>','EXERCISE_CACHE_TTL': 3600,'TWITTER': False,