diff --git a/cof/templates/cof/registration_post.html b/cof/templates/cof/registration_post.html index 0ce9d446..0c6dec9c 100644 --- a/cof/templates/cof/registration_post.html +++ b/cof/templates/cof/registration_post.html @@ -2,10 +2,6 @@ {% block realcontent %}

Inscription d'un nouveau membre

- {% if success %} -

L'inscription de {{ member.first_name }} {{ member.last_name }} ({{ member.username }}) a été enregistrée avec succès. - {% if member.profile.is_cof %}Il est désormais membre du COF n°{{ member.profile.num }} !{% endif %}

- {% endif %}
{% include "cof/registration_form.html" %}
diff --git a/cof/views.py b/cof/views.py index 092f1120..d3120136 100644 --- a/cof/views.py +++ b/cof/views.py @@ -604,7 +604,7 @@ def calendar_ics(request, token): class ConfigUpdate(FormView): form_class = GestioncofConfigForm - template_name = "gestioncof/banner_update.html" + template_name = "cof/banner_update.html" success_url = reverse_lazy("home") def dispatch(self, request, *args, **kwargs): diff --git a/gestioCOF/settings/common.py b/gestioCOF/settings/common.py index 819d6065..fc9f1def 100644 --- a/gestioCOF/settings/common.py +++ b/gestioCOF/settings/common.py @@ -192,7 +192,7 @@ CAS_EMAIL_FORMAT = "%s@clipper.ens.fr" AUTHENTICATION_BACKENDS = ( 'django.contrib.auth.backends.ModelBackend', - 'gestioncof.shared.COFCASBackend', + 'gestion.shared.COFCASBackend', 'kfet.auth.backends.GenericBackend', ) diff --git a/kfet/auth/tests.py b/kfet/auth/tests.py index c2f183cd..108882b3 100644 --- a/kfet/auth/tests.py +++ b/kfet/auth/tests.py @@ -135,7 +135,7 @@ class GenericBackendTests(TestCase): class GenericLoginViewTests(TestCase): def setUp(self): - patcher_messages = mock.patch('gestioncof.signals.messages') + patcher_messages = mock.patch('cof.signals.messages') patcher_messages.start() self.addCleanup(patcher_messages.stop) @@ -280,7 +280,7 @@ class GenericLoginViewTests(TestCase): class TemporaryAuthTests(TestCase): def setUp(self): - patcher_messages = mock.patch('gestioncof.signals.messages') + patcher_messages = mock.patch('cof.signals.messages') patcher_messages.start() self.addCleanup(patcher_messages.stop) diff --git a/kfet/management/commands/loadkfetdevdata.py b/kfet/management/commands/loadkfetdevdata.py index 8af6181a..cf78d472 100644 --- a/kfet/management/commands/loadkfetdevdata.py +++ b/kfet/management/commands/loadkfetdevdata.py @@ -12,11 +12,9 @@ from django.core.management import call_command from cof.management.base import MyBaseCommand from gestion.models import Profile -from kfet.models import Account, Article, OperationGroup, Operation, Checkout -from gestioncof.management.base import MyBaseCommand -from gestioncof.models import CofProfile -from kfet.models import (Account, Checkout, CheckoutStatement, Supplier, - SupplierArticle, Article) +from kfet.models import ( + Account, Article, Checkout, CheckoutStatement, Supplier, SupplierArticle +) # Où sont stockés les fichiers json DATA_DIR = os.path.join(os.path.dirname(os.path.dirname(__file__)), @@ -99,11 +97,11 @@ class Command(MyBaseCommand): # Root account if existing - root_profile = CofProfile.objects.filter(user__username='root') + root_profile = Profile.objects.filter(user__username='root') if root_profile.exists(): self.stdout.write("Création du compte K-Fêt root") root_profile = root_profile.get() - Account.objects.get_or_create(cofprofile=root_profile, + Account.objects.get_or_create(profile=root_profile, trigramme='AAA') # --- diff --git a/kfet/open/tests.py b/kfet/open/tests.py index 476eb6c0..59fe6146 100644 --- a/kfet/open/tests.py +++ b/kfet/open/tests.py @@ -120,7 +120,7 @@ class OpenKfetViewsTest(ChannelTestCase): def setUp(self): # Need this (and here) because of '.login' in setUp - patcher_messages = mock.patch('gestioncof.signals.messages') + patcher_messages = mock.patch('cof.signals.messages') patcher_messages.start() self.addCleanup(patcher_messages.stop) @@ -200,7 +200,7 @@ class OpenKfetConsumerTest(ChannelTestCase): OpenKfetConsumer.group_send('kfet.open.team', {'test': 'plop'}) self.assertIsNone(c.receive()) - @mock.patch('gestioncof.signals.messages') + @mock.patch('cof.signals.messages') def test_team_user(self, mock_messages): """Team user is added to kfet.open.team group.""" # setup team user and its client @@ -232,7 +232,7 @@ class OpenKfetScenarioTest(ChannelTestCase): def setUp(self): # Need this (and here) because of '.login' in setUp - patcher_messages = mock.patch('gestioncof.signals.messages') + patcher_messages = mock.patch('cof.signals.messages') patcher_messages.start() self.addCleanup(patcher_messages.stop) diff --git a/kfet/tests/test_config.py b/kfet/tests/test_config.py index 03c9cf3c..e0c323b7 100644 --- a/kfet/tests/test_config.py +++ b/kfet/tests/test_config.py @@ -1,16 +1,15 @@ -# -*- coding: utf-8 -*- - +import djconfig from decimal import Decimal +from django.contrib.auth import get_user_model from django.test import TestCase from django.utils import timezone -import djconfig - -from gestioncof.models import User from kfet.config import kfet_config from kfet.models import Account +User = get_user_model() + class ConfigTest(TestCase): """Tests suite for kfet configuration.""" diff --git a/kfet/tests/test_statistic.py b/kfet/tests/test_statistic.py index d8db7ec8..48164162 100644 --- a/kfet/tests/test_statistic.py +++ b/kfet/tests/test_statistic.py @@ -10,7 +10,7 @@ from kfet.models import Account, Article, ArticleCategory class TestStats(TestCase): - @patch('gestioncof.signals.messages') + @patch('cof.signals.messages') def test_user_stats(self, mock_messages): """ Checks that we can get the stat-related pages without any problem. diff --git a/kfet/tests/test_tests_utils.py b/kfet/tests/test_tests_utils.py index 8308bd5b..c846bb56 100644 --- a/kfet/tests/test_tests_utils.py +++ b/kfet/tests/test_tests_utils.py @@ -3,7 +3,7 @@ from django.contrib.auth.models import Permission from django.contrib.contenttypes.models import ContentType from django.test import TestCase -from gestioncof.models import CofProfile +from cof.models import CofProfile from ..models import Account from .testcases import TestCaseMixin @@ -76,17 +76,17 @@ class PermHelpersTest(TestCaseMixin, TestCase): ) def test_get_perms(self): - perms = get_perms('kfet.test_perm', 'gestioncof.another_test_perm') + perms = get_perms('kfet.test_perm', 'cof.another_test_perm') self.assertDictEqual(perms, { 'kfet.test_perm': self.perm1, - 'gestioncof.another_test_perm': self.perm2, + 'cof.another_test_perm': self.perm2, }) def test_user_add_perms(self): user = User.objects.create_user(username='user', password='user') user.user_permissions.add(self.perm1) - user_add_perms(user, ['kfet.is_team', 'gestioncof.another_test_perm']) + user_add_perms(user, ['kfet.is_team', 'cof.another_test_perm']) self.assertQuerysetEqual( user.user_permissions.all(), diff --git a/kfet/tests/testcases.py b/kfet/tests/testcases.py index d7d7eac5..3837e519 100644 --- a/kfet/tests/testcases.py +++ b/kfet/tests/testcases.py @@ -228,7 +228,7 @@ class ViewTestCaseMixin(TestCaseMixin): # Signals handlers on login/logout send messages. # Due to the way the Django' test Client performs login, this raise an # error. As workaround, we mock the Django' messages module. - patcher_messages = mock.patch('gestioncof.signals.messages') + patcher_messages = mock.patch('cof.signals.messages') patcher_messages.start() self.addCleanup(patcher_messages.stop)