Skip to content
Snippets Groups Projects
Commit be8e74d0 authored by ynerant's avatar ynerant
Browse files

If a note is saved and the main name changed without changing the normalized...

If a note is saved and the main name changed without changing the normalized form, update the main alias
parent 9f619a9d
No related branches found
No related tags found
1 merge request!111Remove padding around note picture
Pipeline #8647 passed with warnings with stages
in 10 minutes and 10 seconds
......@@ -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):
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment