Self hosted FLOSS fitness/workout, nutrition and weight tracker
Remove regex, add split
James Simasdb6c82852514
diff --git a/wger/exercises/models.py b/wger/exercises/models.pyindex a5dd3c329..ff82552b2 100644--- a/wger/exercises/models.py+++ b/wger/exercises/models.py@@ -19,7 +19,6 @@ import siximport uuidimport loggingimport bleach-import refrom django.db import modelsfrom django.template.loader import render_to_string@@ -331,16 +330,7 @@ class Exercise(AbstractSubmissionModel, AbstractLicenseModel, models.Model):if request.user.has_perm('exercises.add_exercise'):self.status = self.STATUS_ACCEPTEDif not self.license_author:- # Get everything up to semicolon, exclusive.- # Example: my-gym.com:9090 returns my-gym.com- results = re.search('^([^:]+).*', request.get_host())-- if results:- name = results.group(1)- else:- name = request.get_host()-- self.license_author = name+ self.license_author = request.get_host().split(':')[0]else:if not self.license_author:self.license_author = request.user.username