From 541ed59f40deccf1a8f9b86ace2ff7a8c1e6ae81 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Sun, 4 Oct 2020 21:08:35 +0200 Subject: [PATCH] When a membership is created, redirect to the user profile page rather than club detail --- apps/member/tests/test_memberships.py | 8 ++++---- apps/note/models/transactions.py | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/apps/member/tests/test_memberships.py b/apps/member/tests/test_memberships.py index 90b1f382..80c214f0 100644 --- a/apps/member/tests/test_memberships.py +++ b/apps/member/tests/test_memberships.py @@ -205,7 +205,7 @@ class TestMemberships(TestCase): first_name="Toto", bank="Le matelas", )) - self.assertRedirects(response, club.get_absolute_url(), 302, 200) + self.assertRedirects(response, user.profile.get_absolute_url(), 302, 200) self.assertTrue(Membership.objects.filter(user=user, club=club).exists()) @@ -244,9 +244,9 @@ class TestMemberships(TestCase): first_name="Toto", bank="Bank", )) - self.assertRedirects(response, club.get_absolute_url(), 302, 200) + self.assertRedirects(response, user.profile.get_absolute_url(), 302, 200) - response = self.client.get(user.profile.get_absolute_url()) + response = self.client.get(club.get_absolute_url()) self.assertEqual(response.status_code, 200) def test_auto_join_kfet_when_join_bde_with_soge(self): @@ -273,7 +273,7 @@ class TestMemberships(TestCase): first_name="Toto", bank="Société générale", )) - self.assertRedirects(response, bde.get_absolute_url(), 302, 200) + self.assertRedirects(response, user.profile.get_absolute_url(), 302, 200) self.assertTrue(Membership.objects.filter(user=user, club=bde).exists()) self.assertTrue(Membership.objects.filter(user=user, club=kfet).exists()) diff --git a/apps/note/models/transactions.py b/apps/note/models/transactions.py index e0aa30f4..b204e623 100644 --- a/apps/note/models/transactions.py +++ b/apps/note/models/transactions.py @@ -3,7 +3,6 @@ from django.core.exceptions import ValidationError from django.db import models, transaction -from django.db.models import F from django.urls import reverse from django.utils import timezone from django.utils.translation import gettext_lazy as _