Self hosted FLOSS fitness/workout, nutrition and weight tracker
Move views from 'user' view to core
Roland Geider321e1e68814f
diff --git a/wger/manager/templates/user/api_key.html b/wger/core/templates/user/api_key.htmlsimilarity index 86%rename from wger/manager/templates/user/api_key.htmlrename to wger/core/templates/user/api_key.htmlindex a2d1c866f..d060db17d 100644--- a/wger/manager/templates/user/api_key.html+++ b/wger/core/templates/user/api_key.html@@ -57,9 +57,9 @@ https://wger.de/api/v1/workout/?username={{user.username}}&api_key={% if key %}{<p>{% if key %}- <a href="{% url 'api-key' %}?new_key=true" class="btn btn-block">{% trans 'Delete current API key and generate new one' %}</a>+ <a href="{% url 'core:api-key' %}?new_key=true" class="btn btn-block">{% trans 'Delete current API key and generate new one' %}</a>{% else %}- <a href="{% url 'api-key' %}?new_key=true" class="btn btn-block">{% trans 'Generate new API key' %}</a>+ <a href="{% url 'core:api-key' %}?new_key=true" class="btn btn-block">{% trans 'Generate new API key' %}</a>{% endif %}</p>diff --git a/wger/manager/templates/user/change_password.html b/wger/core/templates/user/change_password.htmlsimilarity index 92%rename from wger/manager/templates/user/change_password.htmlrename to wger/core/templates/user/change_password.htmlindex b2db039f6..24ef085e5 100644--- a/wger/manager/templates/user/change_password.html+++ b/wger/core/templates/user/change_password.html@@ -7,7 +7,7 @@{% block content %}-<form action="{% url 'change-password' %}"+<form action="{% url 'core:change-password' %}"method="post"class="ym-form">{% csrf_token %}diff --git a/wger/manager/templates/user/login.html b/wger/core/templates/user/login.htmlsimilarity index 92%rename from wger/manager/templates/user/login.htmlrename to wger/core/templates/user/login.htmlindex 5c12d1155..50ab0bf48 100644--- a/wger/manager/templates/user/login.html+++ b/wger/core/templates/user/login.html@@ -13,7 +13,7 @@{% endblock %}{% block content %}-<form action="{% url 'login' %}"+<form action="{% url 'core:login' %}"method="post"class="ym-form">{% csrf_token %}@@ -61,7 +61,7 @@{% block sidebar %}<h3>{% trans "No account?" %}</h3><p>- <a href="{% url 'wger.manager.views.user.registration' %}">+ <a href="{% url 'core:registration' %}"><img src="{% static 'images/icons/register.svg' %}"width="32"height="32"@@ -71,7 +71,7 @@<h3>{% trans "Forgot password?" %}</h3><p>- <a href="{% url 'django.contrib.auth.views.password_reset' %}">+ <a href="{% url 'core:password_reset' %}"><img src="{% static 'images/icons/reset-password.svg' %}"width="32"height="32"diff --git a/wger/manager/templates/user/password_reset_complete.html b/wger/core/templates/user/password_reset_complete.htmlsimilarity index 78%rename from wger/manager/templates/user/password_reset_complete.htmlrename to wger/core/templates/user/password_reset_complete.htmlindex 2919d8540..2a3c0ff05 100644--- a/wger/manager/templates/user/password_reset_complete.html+++ b/wger/core/templates/user/password_reset_complete.html@@ -7,6 +7,6 @@{% block content %}<p>{% trans "Your password has been set. You may go ahead and log in now." %}</p>-<p><a href="{% url 'login' %}">{% trans 'Log in' %}</a></p>+<p><a href="{% url 'core:login' %}">{% trans 'Log in' %}</a></p>{% endblock %}diff --git a/wger/manager/templates/user/password_reset_confirm.html b/wger/core/templates/user/password_reset_confirm.htmlsimilarity index 100%rename from wger/manager/templates/user/password_reset_confirm.htmlrename to wger/core/templates/user/password_reset_confirm.htmldiff --git a/wger/manager/templates/user/password_reset_done.html b/wger/core/templates/user/password_reset_done.htmlsimilarity index 100%rename from wger/manager/templates/user/password_reset_done.htmlrename to wger/core/templates/user/password_reset_done.htmldiff --git a/wger/manager/templates/user/password_reset_email.html b/wger/core/templates/user/password_reset_email.htmlsimilarity index 82%rename from wger/manager/templates/user/password_reset_email.htmlrename to wger/core/templates/user/password_reset_email.htmlindex 25426b184..e96c49be8 100644--- a/wger/manager/templates/user/password_reset_email.html+++ b/wger/core/templates/user/password_reset_email.html@@ -4,7 +4,7 @@{% trans "Please go to the following page and choose a new password:" %}{% block reset_link %}-{{ protocol }}://{{ domain }}{% url 'django.contrib.auth.views.password_reset_confirm' uidb36=uid token=token %}+{{ protocol }}://{{ domain }}{% url 'core:password_reset_confirm' uidb36=uid token=token %}{% endblock %}{% trans "Your username, in case you've forgotten:" %} {{ user.username }}diff --git a/wger/manager/templates/user/password_reset_form.html b/wger/core/templates/user/password_reset_form.htmlsimilarity index 100%rename from wger/manager/templates/user/password_reset_form.htmlrename to wger/core/templates/user/password_reset_form.htmldiff --git a/wger/manager/templates/user/preferences.html b/wger/core/templates/user/preferences.htmlsimilarity index 93%rename from wger/manager/templates/user/preferences.htmlrename to wger/core/templates/user/preferences.htmlindex 4ecaa055a..a956e0412 100644--- a/wger/manager/templates/user/preferences.html+++ b/wger/core/templates/user/preferences.html@@ -19,7 +19,7 @@ $(function() {{% block content %}-<form action="{% url 'preferences' %}"+<form action="{% url 'core:preferences' %}"method="post"class="ym-form">{% csrf_token %}@@ -67,7 +67,7 @@ $(function() {{% block sidebar %}<h3>{% trans "Options" %}</h3><p>- <a href="{% url 'logout' %}"+ <a href="{% url 'core:logout' %}"class="browserid-logout"><img src="{% static 'images/icons/logout.svg' %}"width="32"@@ -77,7 +77,7 @@ $(function() {{% trans "Logout" %}</a></p><p>- <a href="{% url 'change-password' %}">+ <a href="{% url 'core:change-password' %}"><img src="{% static 'images/icons/preferences.svg' %}"width="32"height="32"@@ -86,7 +86,7 @@ $(function() {{% trans "Change password" %}</a></p><p>- <a href="{% url 'api-key' %}">+ <a href="{% url 'core:api-key' %}"><img src="{% static 'images/icons/internet.svg' %}"width="32"height="32"diff --git a/wger/manager/tests/test_preferences.py b/wger/core/tests/test_preferences.pysimilarity index 95%rename from wger/manager/tests/test_preferences.pyrename to wger/core/tests/test_preferences.pyindex 79ceb2b02..9e61b6ebf 100644--- a/wger/manager/tests/test_preferences.py+++ b/wger/core/tests/test_preferences.py@@ -38,7 +38,7 @@ class PreferencesTestCase(WorkoutManagerTestCase):'''self.user_login('test')- response = self.client.get(reverse('preferences'))+ response = self.client.get(reverse('core:preferences'))profile = User.objects.get(username='test').userprofileself.assertFalse(profile.show_comments)@@ -47,7 +47,7 @@ class PreferencesTestCase(WorkoutManagerTestCase):self.assertTemplateUsed('preferences.html')# Change some preferences- response = self.client.post(reverse('preferences'),+ response = self.client.post(reverse('core:preferences'),{'show_comments': True,'show_english_ingredients': True,'email': '[email protected]',@@ -59,7 +59,7 @@ class PreferencesTestCase(WorkoutManagerTestCase):'timer_pause': 100})self.assertEqual(response.status_code, 302)- response = self.client.get(reverse('preferences'))+ response = self.client.get(reverse('core:preferences'))profile = User.objects.get(username='test').userprofileself.assertTrue(profile.show_english_ingredients)self.assertTrue(profile.workout_reminder_active)@@ -68,7 +68,7 @@ class PreferencesTestCase(WorkoutManagerTestCase):self.assertEqual(User.objects.get(username='test').email, '[email protected]')# Change some preferences- response = self.client.post(reverse('preferences'),+ response = self.client.post(reverse('core:preferences'),{'show_comments': False,'show_english_ingredients': True,'email': '',@@ -80,7 +80,7 @@ class PreferencesTestCase(WorkoutManagerTestCase):'timer_pause': 40})self.assertEqual(response.status_code, 302)- response = self.client.get(reverse('preferences'))+ response = self.client.get(reverse('core:preferences'))profile = response.context['user'].userprofileself.assertFalse(profile.show_comments)self.assertTrue(profile.show_english_ingredients)@@ -178,7 +178,7 @@ class AjaxPreferencesTestCase(WorkoutManagerTestCase):'''# Set the 'show comments' option- response = self.client.get(reverse('wger.manager.views.user.api_user_preferences'),+ response = self.client.get(reverse('core:user-api-preferences'),{'do': 'set_show-comments','show': '1'},HTTP_X_REQUESTED_WITH='XMLHttpRequest')@@ -186,14 +186,14 @@ class AjaxPreferencesTestCase(WorkoutManagerTestCase):self.assertEqual('Success', response.content)self.assertEqual(response.status_code, 200)- response = self.client.get(reverse('preferences'))+ response = self.client.get(reverse('core:preferences'))profile = response.context['user'].userprofileself.assertTrue(profile.show_comments)self.assertFalse(profile.show_english_ingredients)self.assertEqual(response.context['user'].email, '[email protected]')# Set the 'english ingredients' option- response = self.client.get(reverse('wger.manager.views.user.api_user_preferences'),+ response = self.client.get(reverse('core:user-api-preferences'),{'do': 'set_english-ingredients','show': '1'},HTTP_X_REQUESTED_WITH='XMLHttpRequest')@@ -201,7 +201,7 @@ class AjaxPreferencesTestCase(WorkoutManagerTestCase):self.assertEqual('Success', response.content)self.assertEqual(response.status_code, 200)- response = self.client.get(reverse('preferences'))+ response = self.client.get(reverse('core:preferences'))profile = response.context['user'].userprofileself.assertTrue(profile.show_comments)self.assertTrue(profile.show_english_ingredients)diff --git a/wger/manager/views/user.py b/wger/core/views/user.pysimilarity index 96%rename from wger/manager/views/user.pyrename to wger/core/views/user.pyindex cd42f3564..f79d37b20 100644--- a/wger/manager/views/user.py+++ b/wger/core/views/user.py@@ -63,7 +63,7 @@ def logout(request):django_logout(request)if user.is_authenticated() and user.userprofile.is_temporary:user.delete()- return HttpResponseRedirect(reverse('login'))+ return HttpResponseRedirect(reverse('core:login'))def registration(request):@@ -109,7 +109,7 @@ def registration(request):template_data['form'] = formtemplate_data['title'] = _('Register')template_data['form_fields'] = [i for i in form]- template_data['form_action'] = reverse('registration')+ template_data['form_action'] = reverse('core:registration')template_data['submit_text'] = _('Register')return render(request, 'form.html', template_data)@@ -158,7 +158,7 @@ def preferences(request):if redirect:messages.success(request, _('Settings successfully updated'))- return HttpResponseRedirect(reverse('preferences'))+ return HttpResponseRedirect(reverse('core:preferences'))else:return render(request, 'user/preferences.html', template_data)@@ -214,7 +214,7 @@ def api_key(request):key.save()# Redirect to get rid of the GET parameter- return HttpResponseRedirect(reverse('api-key'))+ return HttpResponseRedirect(reverse('core:api-key'))context['key'] = keydiff --git a/wger/manager/templates/index.html b/wger/manager/templates/index.htmlindex 466e90243..346ac7155 100644--- a/wger/manager/templates/index.html+++ b/wger/manager/templates/index.html@@ -136,7 +136,7 @@{% block sidebar %}<h3>{% trans "Options" %}</h3><p>-<a href="{% url 'wger.manager.views.user.preferences' %}">+<a href="{% url 'core:preferences' %}"><img src="{% static 'images/icons/preferences.svg' %}"width="32"height="32"diff --git a/wger/manager/templates/mobile/index.html b/wger/manager/templates/mobile/index.htmlindex dc5afbe00..4daf6ee83 100644--- a/wger/manager/templates/mobile/index.html+++ b/wger/manager/templates/mobile/index.html@@ -231,7 +231,7 @@ its default duration in your settings.{% endblocktrans %}</a></div><div class="ui-block-a">- <a href="{% url 'wger.manager.views.user.preferences' %}" data-role="button">+ <a href="{% url 'core:preferences' %}" data-role="button"><img src="{% static 'images/icons/preferences.svg' %}"width="32"height="32"diff --git a/wger/manager/templates/mobile/navigation.html b/wger/manager/templates/mobile/navigation.htmlindex 77deaae81..c606e11f4 100644--- a/wger/manager/templates/mobile/navigation.html+++ b/wger/manager/templates/mobile/navigation.html@@ -123,7 +123,7 @@{# Preferences #}{% if user.is_authenticated and not user.userprofile.is_temporary %}<li>- <a href="{% url 'wger.manager.views.user.preferences' %}">+ <a href="{% url 'core:preferences' %}">{% trans "Preferences" %}</a></li>@@ -147,7 +147,7 @@{# Logout #}{% if user.is_authenticated and not user.userprofile.is_temporary %}<li>- <a href="{% url 'logout' %}" data-ajax="false" class="browserid-logout">{% trans "Logout" %}</a>+ <a href="{% url 'core:logout' %}" data-ajax="false" class="browserid-logout">{% trans "Logout" %}</a></li>{% endif %}</ul>@@ -170,10 +170,10 @@<ul data-role="listview" data-inset="false" style="margin-top:2em;" data-theme="c"><li>- <a href="{% url 'login' %}">{% trans "Login" %}</a>+ <a href="{% url 'core:login' %}">{% trans "Login" %}</a></li><li>- <a href="{% url 'wger.manager.views.user.registration' %}" data-ajax="false">{% trans "Register" %}</a>+ <a href="{% url 'core:registration' %}" data-ajax="false">{% trans "Register" %}</a></li></ul>{% endif %}diff --git a/wger/manager/templates/mobile/template.html b/wger/manager/templates/mobile/template.htmlindex 9e5c19b92..513645890 100644--- a/wger/manager/templates/mobile/template.html+++ b/wger/manager/templates/mobile/template.html@@ -66,7 +66,7 @@</div><div role="main" class="ui-content">{% trans "You are using a guest account, data entered will be deleted after a week."%}- <a href="{% url 'wger.manager.views.user.registration' %}"+ <a href="{% url 'core:registration' %}"rel="nofollow"data-role="button"data-mini="true"@@ -117,7 +117,7 @@<ul><li>{% if not user.is_authenticated %}- <a href="{% url 'login' %}" data-ajax="false">{% trans "Login" %}</a>+ <a href="{% url 'core:login' %}" data-ajax="false">{% trans "Login" %}</a>{% else %}<a href="{% url 'core:index' %}">{% trans "Dashboard" %}</a>{% endif %}diff --git a/wger/manager/templates/mobile/user/login.html b/wger/manager/templates/mobile/user/login.htmlindex dfaa901ae..fc9a1cd73 100644--- a/wger/manager/templates/mobile/user/login.html+++ b/wger/manager/templates/mobile/user/login.html@@ -11,7 +11,7 @@{% block header %}{% endblock %}{% block content %}-<form action="{% url 'login' %}"+<form action="{% url 'core:login' %}"method="post"class="ym-form"data-ajax="false">@@ -60,7 +60,7 @@{% block sidebar %}<h3>{% trans "No account?" %}</h3><p>- <a href="{% url 'wger.manager.views.user.registration' %}"+ <a href="{% url 'core:registration' %}"data-role="button"data-ajax="false"><img src="{% static 'images/icons/register.svg' %}"@@ -72,7 +72,7 @@<h3>{% trans "Forgot password?" %}</h3><p>- <a href="{% url 'django.contrib.auth.views.password_reset' %}" data-role="button">+ <a href="{% url 'core:password_reset' %}" data-role="button"><img src="{% static 'images/icons/reset-password.svg' %}"width="32"height="32"diff --git a/wger/manager/templates/mobile/user/preferences.html b/wger/manager/templates/mobile/user/preferences.htmlindex 41cfa783f..20a6aa799 100644--- a/wger/manager/templates/mobile/user/preferences.html+++ b/wger/manager/templates/mobile/user/preferences.html@@ -8,7 +8,7 @@{% block content %}-<form action="{% url 'preferences' %}"+<form action="{% url 'core:preferences' %}"method="post"class="ym-form">{% csrf_token %}@@ -60,7 +60,7 @@{% block sidebar %}<h3>{% trans "Options" %}</h3><p>- <a href="{% url 'api-key' %}"+ <a href="{% url 'core:api-key' %}"data-role="button"><img src="{% static 'images/icons/internet.svg' %}"width="32"@@ -70,7 +70,7 @@{% trans "API key" %}</a></p><p>- <a href="{% url 'change-password' %}"+ <a href="{% url 'core:change-password' %}"data-role="button"><img src="{% static 'images/icons/preferences.svg' %}"width="32"@@ -80,7 +80,7 @@{% trans "Change password" %}</a></p><p>- <a href="{% url 'logout' %}"+ <a href="{% url 'core:logout' %}"data-role="button"class="browserid-logout"><img src="{% static 'images/icons/logout.svg' %}"diff --git a/wger/manager/templates/mobile/workout/view.html b/wger/manager/templates/mobile/workout/view.htmlindex 5da45fb46..2351dfec3 100644--- a/wger/manager/templates/mobile/workout/view.html+++ b/wger/manager/templates/mobile/workout/view.html@@ -71,7 +71,7 @@ $( document ).off("pageinit").on("pageinit", function() {<a id="exercise-comments-toggle"- href="{% url 'wger.manager.views.user.preferences' %}"+ href="{% url 'core:preferences' %}"data-role="button"data-mini="true">{% trans "Show/Hide exercise comments" %}diff --git a/wger/manager/templates/navigation.html b/wger/manager/templates/navigation.htmlindex bacbd42a4..1cb638eb8 100644--- a/wger/manager/templates/navigation.html+++ b/wger/manager/templates/navigation.html@@ -145,9 +145,9 @@<b class="caret"></b></a><ul class="dropdown-menu">- <li><a href="{% url 'login' %}">{% trans "Login" %}</a></li>- <li><a href="{% url 'wger.manager.views.user.registration' %}">{% trans "Register" %}</a></li>- <li><a href="{% url 'django.contrib.auth.views.password_reset' %}">{% trans "Reset password" %}</a></li>+ <li><a href="{% url 'core:login' %}">{% trans "Login" %}</a></li>+ <li><a href="{% url 'core:registration' %}">{% trans "Register" %}</a></li>+ <li><a href="{% url 'core:password_reset' %}">{% trans "Reset password" %}</a></li></ul></ul>{% endif %}diff --git a/wger/manager/templates/template.html b/wger/manager/templates/template.htmlindex ff0c62432..2493ad491 100644--- a/wger/manager/templates/template.html+++ b/wger/manager/templates/template.html@@ -91,7 +91,7 @@<div class="float-right" style="margin-right:1em;margin-top:0em;position:absolute;right:0px;">{% if user.is_authenticated and not user.userprofile.is_temporary %}- <a href="{% url 'wger.manager.views.user.preferences' %}">+ <a href="{% url 'core:preferences' %}">{% if user.email %}{{user.email}}{% else %}@@ -100,13 +100,13 @@</a>|- <a href="{% url 'logout' %}" class="browserid-logout">+ <a href="{% url 'core:logout' %}" class="browserid-logout">{% trans "Logout" %}</a>{% else %}- <a href="{% url 'login' %}">{% trans "Login" %}</a>+ <a href="{% url 'core:login' %}">{% trans "Login" %}</a>|- <a href="{% url 'wger.manager.views.user.registration' %}">{% trans "Register" %}</a>+ <a href="{% url 'core:registration' %}">{% trans "Register" %}</a>{% endif %}|<a href="{% url 'core:contact' %}">{% trans "Get in touch" %}</a>diff --git a/wger/manager/templates/workout/email_reminder.html b/wger/manager/templates/workout/email_reminder.htmlindex ecb230474..de615c3ef 100644--- a/wger/manager/templates/workout/email_reminder.html+++ b/wger/manager/templates/workout/email_reminder.html@@ -16,4 +16,4 @@ reminders, deactivate the option in your settings.{% endblocktrans %}* http://{{site}}{{workout.get_absolute_url}}* http://{{site}}{% url 'workout-add' %}-* http://{{site}}{% url 'preferences' %}\ No newline at end of file+* http://{{site}}{% url 'core:preferences' %}\ No newline at end of filediff --git a/wger/manager/templates/workout/view.html b/wger/manager/templates/workout/view.htmlindex 1fc20caeb..ea4d6ec3f 100644--- a/wger/manager/templates/workout/view.html+++ b/wger/manager/templates/workout/view.html@@ -67,7 +67,7 @@ $(document).ready(function() {<p><a href="{% url 'day-add' workout.id %}" class="modal-dialog">{% trans "Add training day" %}</a>|- <a id="exercise-comments-toggle" href="{% url 'preferences' %}">{% trans "Show/Hide exercise comments" %}</a>+ <a id="exercise-comments-toggle" href="{% url 'core:preferences' %}">{% trans "Show/Hide exercise comments" %}</a></p>{% endblock %}diff --git a/wger/manager/tests/test_apikey.py b/wger/manager/tests/test_apikey.pyindex 4c33fa01f..992e2def6 100644--- a/wger/manager/tests/test_apikey.py+++ b/wger/manager/tests/test_apikey.py@@ -38,14 +38,14 @@ class ApiKeyTestCase(WorkoutManagerTestCase):user = User.objects.get(username='test')# User already has a key- response = self.client.get(reverse('api-key'))+ response = self.client.get(reverse('core:api-key'))self.assertEqual(response.status_code, 200)self.assertContains(response, 'Delete current API key and generate new one')self.assertTrue(ApiKey.objects.get(user=user))# User has no keysApiKey.objects.get(user=user).delete()- response = self.client.get(reverse('api-key'))+ response = self.client.get(reverse('core:api-key'))self.assertEqual(response.status_code, 200)self.assertContains(response, 'You have no API key yet')self.assertRaises(ApiKey.DoesNotExist, ApiKey.objects.get, user=user)@@ -59,7 +59,7 @@ class ApiKeyTestCase(WorkoutManagerTestCase):user = User.objects.get(username='test')key_before = ApiKey.objects.get(user=user)- response = self.client.get(reverse('api-key'), {'new_key': True})+ response = self.client.get(reverse('core:api-key'), {'new_key': True})self.assertEqual(response.status_code, 302)response = self.client.get(response['Location'])self.assertEqual(response.status_code, 200)diff --git a/wger/manager/tests/test_change_password.py b/wger/manager/tests/test_change_password.pyindex 0d194b8fb..cdbd181c0 100644--- a/wger/manager/tests/test_change_password.py+++ b/wger/manager/tests/test_change_password.py@@ -30,7 +30,7 @@ class ChangePasswordTestCase(WorkoutManagerTestCase):def change_password(self, fail=True):# Fetch the change passwort page- response = self.client.get(reverse('change-password'))+ response = self.client.get(reverse('core:change-password'))if fail:self.assertEqual(response.status_code, 302)@@ -42,7 +42,7 @@ class ChangePasswordTestCase(WorkoutManagerTestCase):'new_password1': 'secret','new_password2': 'secret'}- response = self.client.post(reverse('change-password'), form_data)+ response = self.client.post(reverse('core:change-password'), form_data)self.assertEqual(response.status_code, 302)# Check the new password was accepteddiff --git a/wger/manager/tests/test_registration.py b/wger/manager/tests/test_registration.pyindex 29ef07f10..a8966d6a6 100644--- a/wger/manager/tests/test_registration.py+++ b/wger/manager/tests/test_registration.py@@ -30,7 +30,7 @@ class RegistrationTestCase(WorkoutManagerTestCase):def test_register(self):# Fetch the registration page- response = self.client.get(reverse('registration'))+ response = self.client.get(reverse('core:registration'))self.assertEqual(response.status_code, 200)# Fill in the registration form@@ -42,20 +42,20 @@ class RegistrationTestCase(WorkoutManagerTestCase):count_before = User.objects.count()# Wrong email- response = self.client.post(reverse('registration'), registration_data)+ response = self.client.post(reverse('core:registration'), registration_data)self.assertFalse(response.context['form'].is_valid())self.user_logout()# Correct emailregistration_data['email'] = '[email protected]'- response = self.client.post(reverse('registration'), registration_data)+ response = self.client.post(reverse('core:registration'), registration_data)count_after = User.objects.count()self.assertEqual(response.status_code, 302)self.assertEqual(count_before + 1, count_after)self.user_logout()# Username already exists- response = self.client.post(reverse('registration'), registration_data)+ response = self.client.post(reverse('core:registration'), registration_data)count_after = User.objects.count()self.assertFalse(response.context['form'].is_valid())self.assertEqual(response.status_code, 200)@@ -63,7 +63,7 @@ class RegistrationTestCase(WorkoutManagerTestCase):# Email already existsregistration_data['username'] = 'my.other.username'- response = self.client.post(reverse('registration'), registration_data)+ response = self.client.post(reverse('core:registration'), registration_data)count_after = User.objects.count()self.assertFalse(response.context['form'].is_valid())self.assertEqual(response.status_code, 200)@@ -71,13 +71,13 @@ class RegistrationTestCase(WorkoutManagerTestCase):# No emailregistration_data['email'] = ''- response = self.client.post(reverse('registration'), registration_data)+ response = self.client.post(reverse('core:registration'), registration_data)count_after = User.objects.count()self.assertEqual(response.status_code, 302)self.assertEqual(count_before + 2, count_after)# Already logged in- response = self.client.post(reverse('registration'), registration_data)+ response = self.client.post(reverse('core:registration'), registration_data)count_after = User.objects.count()self.assertEqual(response.status_code, 302)self.assertEqual(count_before + 2, count_after)diff --git a/wger/manager/urls.py b/wger/manager/urls.pyindex 2d6b3c044..2aea7b4b6 100644--- a/wger/manager/urls.py+++ b/wger/manager/urls.py@@ -1,18 +1,9 @@from django.conf.urls import patterns, urlfrom django.contrib.auth.decorators import login_required-from django.core.urlresolvers import reverse_lazyfrom wger.manager.views import schedulefrom wger.manager.views import schedule_step-from wger.manager.views.workout import WorkoutEditView-from wger.manager.views.workout import WorkoutDeleteView-from wger.manager.views.log import WorkoutLogDetailView-from wger.manager.views.log import WorkoutLogAddView-from wger.manager.views.log import WorkoutLogUpdateView-from wger.manager.views.day import DayEditView-from wger.manager.views.day import DayCreateViewfrom wger.manager.views import ical-from wger.manager.views import userfrom wger.manager.views import workoutfrom wger.manager.views import logfrom wger.manager.views import set@@ -22,20 +13,6 @@ from wger.manager.views import workout_sessionurlpatterns = patterns('wger.manager.views',- # User- url(r'^user/logout$',- user.logout,- name='logout'),- url(r'^user/registration$',- user.registration,- name='registration'),- url(r'^user/preferences$',- user.preferences,- name='preferences'),- url(r'^user/api-key$',- user.api_key,- name='api-key'),-# Workouturl(r'^workout/overview$',workout.overview,@@ -47,22 +24,22 @@ urlpatterns = patterns('wger.manager.views',workout.copy_workout,name='workout-copy'),url(r'^workout/(?P<pk>\d+)/edit/$',- WorkoutEditView.as_view(),+ workout.WorkoutEditView.as_view(),name='workout-edit'),url(r'^workout/(?P<pk>\d+)/delete/$',- WorkoutDeleteView.as_view(),+ workout.WorkoutDeleteView.as_view(),name='workout-delete'),url(r'^workout/(?P<id>\d+)/view/$','workout.view',name='workout-view'),url(r'^workout/(?P<pk>\d+)/log/$',- WorkoutLogDetailView.as_view(),+ log.WorkoutLogDetailView.as_view(),name='workout-log'),url(r'^workout/log/edit-entry/(?P<pk>\d+)$',- WorkoutLogUpdateView.as_view(),+ log.WorkoutLogUpdateView.as_view(),name='workout-log-edit'),url(r'^workout/(?P<workout_pk>\d+)/log/add$',- WorkoutLogAddView.as_view(),+ log.WorkoutLogAddView.as_view(),name='workout-log-add'),url(r'^workout/calendar$',log.calendar,@@ -123,10 +100,10 @@ urlpatterns = patterns('wger.manager.views',# Daysurl(r'^workout/day/(?P<pk>\d+)/edit/$',- login_required(DayEditView.as_view()),+ login_required(day.DayEditView.as_view()),name='day-edit'),url(r'^workout/(?P<workout_pk>\d+)/day/add/$',- login_required(DayCreateView.as_view()),+ login_required(day.DayCreateView.as_view()),name='day-add'),url(r'^workout/day/(?P<pk>\d+)/delete/$',day.delete,@@ -150,43 +127,9 @@ urlpatterns = patterns('wger.manager.views',# AJAXurl(r'^workout/api/edit-set$', set.api_edit_set),- url(r'^workout/api/user-preferences$', user.api_user_preferences),)# PDF stuff is in a different fileurlpatterns = urlpatterns + patterns('wger.manager.pdf',url(r'^workout/(?P<id>\d+)/pdf/$', 'workout_log'))-# Password reset is implemented by Django, no need to cook our own soup here-# (besides the templates)-urlpatterns = urlpatterns + patterns('',- url(r'^user/login$',- user.login,- name='login'),-- url(r'^user/password/change$',- 'django.contrib.auth.views.password_change',- {'template_name': 'user/change_password.html',- 'post_change_redirect': reverse_lazy('preferences')},- name='change-password'),-- url(r'^user/password/reset/$',- 'django.contrib.auth.views.password_reset',- {'template_name': 'user/password_reset_form.html'},- name='password_reset'),-- url(r'^user/password/reset/done/$',- 'django.contrib.auth.views.password_reset_done',- {'template_name': 'user/password_reset_done.html'},- name='password_reset_done'),-- url(r'^user/password/reset/check/(?P<uidb36>[0-9A-Za-z]{1,13})-(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',- 'django.contrib.auth.views.password_reset_confirm',- {'template_name': 'user/password_reset_confirm.html'},- name='password_reset_confirm'),-- url(r'^user/password/reset/complete/$',- 'django.contrib.auth.views.password_reset_complete',- {'template_name': 'user/password_reset_complete.html'},- name='password_reset_complete'),- )diff --git a/wger/nutrition/templates/mobile/plan/view.html b/wger/nutrition/templates/mobile/plan/view.htmlindex 281b033ee..214c8ea43 100644--- a/wger/nutrition/templates/mobile/plan/view.html+++ b/wger/nutrition/templates/mobile/plan/view.html@@ -209,7 +209,7 @@ $(document).ready(function() {{% if language.short_name != 'en' %}<p>{% trans "If you find the ingredient list too short, you might want to activate the preference to also show English ingredients." %}- <a href="{% url 'preferences' %}" id="ajax-english-ingredients">{% trans "That's done here" %}</a>:+ <a href="{% url 'core:preferences' %}" id="ajax-english-ingredients">{% trans "That's done here" %}</a>:{% if user.userprofile.show_english_ingredients %}<img src="{% static 'images/icons/status-on.svg' %}"width="20"diff --git a/wger/nutrition/templates/plan/view.html b/wger/nutrition/templates/plan/view.htmlindex a90fd37f4..5e04fec4f 100644--- a/wger/nutrition/templates/plan/view.html+++ b/wger/nutrition/templates/plan/view.html@@ -156,7 +156,7 @@ $(document).ready(function() {{% if language.short_name != 'en' %}<p>{% trans "If you find the ingredient list too short, you might want to activate the preference to also show English ingredients." %}- <a href="{% url 'preferences' %}" id="ajax-english-ingredients">{% trans "That's done here" %}</a>:+ <a href="{% url 'core:preferences' %}" id="ajax-english-ingredients">{% trans "That's done here" %}</a>:{% if user.userprofile.show_english_ingredients %}<img src="{% static 'images/icons/status-on.svg' %}"width="20"diff --git a/wger/software/templates/api.html b/wger/software/templates/api.htmlindex 6eed4d1d5..538f70ceb 100644--- a/wger/software/templates/api.html+++ b/wger/software/templates/api.html@@ -153,5 +153,5 @@ This is also new for us, if you plan on using the API,</div><p><a href="/api/v1/?format=json" class="btn btn-block" rel="nofollow">Browse the API</a></p>-<p><a href="{% url 'api-key' %}" class="btn btn-block">Generate API KEY</a></p>+<p><a href="{% url 'core:api-key' %}" class="btn btn-block">Generate API KEY</a></p>{% endblock %}