From 3990009400527f68601e76a7e0e59715cce58dfa Mon Sep 17 00:00:00 2001 From: Pierre-antoine Comby Date: Mon, 9 Mar 2020 18:06:51 +0100 Subject: [PATCH 1/7] remove django guardian settings --- note_kfet/settings/base.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/note_kfet/settings/base.py b/note_kfet/settings/base.py index a1dbb929..4fe12fbf 100644 --- a/note_kfet/settings/base.py +++ b/note_kfet/settings/base.py @@ -128,7 +128,6 @@ PASSWORD_HASHERS = [ AUTHENTICATION_BACKENDS = ( 'django.contrib.auth.backends.ModelBackend', # this is default - 'guardian.backends.ObjectPermissionBackend', ) REST_FRAMEWORK = { @@ -143,10 +142,6 @@ REST_FRAMEWORK = { ] } -ANONYMOUS_USER_NAME = None # Disable guardian anonymous user - -GUARDIAN_GET_CONTENT_TYPE = 'polymorphic.contrib.guardian.get_polymorphic_base_content_type' - # Internationalization # https://docs.djangoproject.com/en/2.2/topics/i18n/ From 0de2c18bec385e350fb68bc4d38b515f96c78e3b Mon Sep 17 00:00:00 2001 From: Pierre-antoine Comby Date: Mon, 9 Mar 2020 18:08:37 +0100 Subject: [PATCH 2/7] profile is first created via signal. --- apps/member/views.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/member/views.py b/apps/member/views.py index 88bd2678..21c8de5f 100644 --- a/apps/member/views.py +++ b/apps/member/views.py @@ -49,10 +49,10 @@ class UserCreateView(CreateView): def form_valid(self, form): profile_form = ProfileForm(self.request.POST) if form.is_valid() and profile_form.is_valid(): - user = form.save() - profile = profile_form.save(commit=False) - profile.user = user - profile.save() + user = form.save(commit=False) + user.profile = profile_form.save(commit=False) + user.save() + user.profile.save() return super().form_valid(form) From 08d692c0daf637642d4ae2d6a396ca97433ba21f Mon Sep 17 00:00:00 2001 From: Pierre-antoine Comby Date: Mon, 9 Mar 2020 18:10:24 +0100 Subject: [PATCH 3/7] fix #39 --- apps/note/tables.py | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/note/tables.py b/apps/note/tables.py index 9a2dce45..53fca321 100644 --- a/apps/note/tables.py +++ b/apps/note/tables.py @@ -16,6 +16,7 @@ class HistoryTable(tables.Table): 'table table-condensed table-striped table-hover' } model = Transaction + exclude = ("polymorphic_ctype",) template_name = 'django_tables2/bootstrap4.html' sequence = ('...', 'total', 'valid') From dad1889c8d95f3c86d2eed9b105fc9874ce4754d Mon Sep 17 00:00:00 2001 From: Pierre-antoine Comby Date: Mon, 9 Mar 2020 18:24:31 +0100 Subject: [PATCH 4/7] move cas fixture to own file --- note_kfet/fixtures/cas.json | 11 +++++++++++ note_kfet/fixtures/initial.json | 11 +---------- 2 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 note_kfet/fixtures/cas.json diff --git a/note_kfet/fixtures/cas.json b/note_kfet/fixtures/cas.json new file mode 100644 index 00000000..c3109d19 --- /dev/null +++ b/note_kfet/fixtures/cas.json @@ -0,0 +1,11 @@ +[ + { + "model": "cas_server.servicepattern", + "pk": 1, + "fields": { + "pos": 1, + "pattern": ".*", + "name": "REPLACEME" + } + } +] diff --git a/note_kfet/fixtures/initial.json b/note_kfet/fixtures/initial.json index 1b779980..72e47234 100644 --- a/note_kfet/fixtures/initial.json +++ b/note_kfet/fixtures/initial.json @@ -6,14 +6,5 @@ "domain": "localhost", "name": "La Note Kfet \ud83c\udf7b" } - }, - { - "model": "cas_server.servicepattern", - "pk": 1, - "fields": { - "pos": 1, - "pattern": ".*", - "name": "REPLACEME" - } } -] \ No newline at end of file +] From e1063fcaa2c89c0a1ab5833c1155c4975d0be8a4 Mon Sep 17 00:00:00 2001 From: Pierre-antoine Comby Date: Mon, 9 Mar 2020 18:35:11 +0100 Subject: [PATCH 5/7] translation in navbar and transfer tab --- templates/base.html | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/templates/base.html b/templates/base.html index 6814bedf..887bc970 100644 --- a/templates/base.html +++ b/templates/base.html @@ -67,16 +67,19 @@ SPDX-License-Identifier: GPL-3.0-or-later