Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

temporary code removed , added when db not initialized properly

pankaj-basnetffbb6450005e
diff --git a/wger/tasks.py b/wger/tasks.py
index 45b3df3cc..106328927 100644
--- a/wger/tasks.py
+++ b/wger/tasks.py
@@ -106,14 +106,6 @@ def create_or_reset_admin(context, settings_path: str = None):
User.objects.get(username='admin')
print("*** Password for user admin was reset to 'adminadmin'")
except User.DoesNotExist:
- # TODO : by pankaj(pbc260321 bpan) , added 7 lines. remove 7 lines later.
- user = User.objects.create_user('username', '[email protected]', 'Cfehome199#')
- user.save()
- user_profile = user.userprofile
- user_profile.is_temporary = True
- user_profile.age = 25
- user_profile.height = 175
- user_profile.save()
print('*** Created default admin user')
current_dir = os.path.dirname(os.path.abspath(__file__))
diff --git a/wger/utils/context_processor.py b/wger/utils/context_processor.py
index 544b6d431..083017965 100644
--- a/wger/utils/context_processor.py
+++ b/wger/utils/context_processor.py
@@ -103,15 +103,9 @@ def get_custom_header(request):
if request.user.is_authenticated and request.user.userprofile.gym:
current_gym = request.user.userprofile.gym
else:
- # TODO: # by pankaj (commented 3 lines , uncomment later . delete lines in this else clause)
- # global_gymconfig = GymConfig.objects.get(pk=1)
- # if global_gymconfig.default_gym:
- # current_gym = global_gymconfig.default_gym
- # Proposed change in wger/utils/context_processor.py
- try:
- global_gymconfig = GymConfig.objects.get(pk=1)
- except GymConfig.DoesNotExist:
- global_gymconfig = None # Or a default fallback object
+ global_gymconfig = GymConfig.objects.get(pk=1)
+ if global_gymconfig.default_gym:
+ current_gym = global_gymconfig.default_gym
# Put the custom header together
custom_header = None