From be8e74d0562cae4604d8672644ea3022f7585100 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Sat, 5 Sep 2020 15:41:47 +0200 Subject: [PATCH 1/2] If a note is saved and the main name changed without changing the normalized form, update the main alias --- apps/note/models/notes.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/note/models/notes.py b/apps/note/models/notes.py index 604e81ae..877247df 100644 --- a/apps/note/models/notes.py +++ b/apps/note/models/notes.py @@ -109,6 +109,12 @@ class Note(PolymorphicModel): # Save alias a.note = self a.save(force_insert=True) + else: + # Check if the name of the note changed without changing the normalized form of the alias + alias = Alias.objects.get(normalized_name=Alias.normalize(str(self))) + if alias.name != str(self): + alias.name = str(self) + alias.save() def clean(self, *args, **kwargs): """ From 00bc9550f26eb367c182ecc65eff81704b5eff97 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Sat, 5 Sep 2020 19:27:22 +0200 Subject: [PATCH 2/2] Add padding to the the note picture (cc shirenn) --- apps/note/templates/note/transaction_form.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/note/templates/note/transaction_form.html b/apps/note/templates/note/transaction_form.html index 871088d4..9c484799 100644 --- a/apps/note/templates/note/transaction_form.html +++ b/apps/note/templates/note/transaction_form.html @@ -37,7 +37,7 @@ SPDX-License-Identifier: GPL-2.0-or-later
{# Preview note profile (picture, username and balance) #}
-
+