When data is imported from the NK15, prevent users whenever some aliases are deleted

This commit is contained in:
Yohann D'ANELLO 2020-08-24 12:41:51 +02:00
parent 550242226e
commit b25935e579
6 changed files with 444 additions and 425 deletions

View File

@ -222,7 +222,7 @@ class Alias(models.Model):
normalized_name = models.CharField(
max_length=255,
unique=True,
default='',
blank=False,
editable=False,
)
note = models.ForeignKey(
@ -257,6 +257,8 @@ class Alias(models.Model):
if len(normalized_name) >= 255:
raise ValidationError(_('Alias is too long.'),
code='alias_too_long')
if not normalized_name:
raise ValidationError(_('This alias contains only complex character. Please use a more simple alias.'))
try:
sim_alias = Alias.objects.get(normalized_name=normalized_name)
if self != sim_alias:

@ -1 +1 @@
Subproject commit 81709539a2b4b230f506291085fbee3d7d9ac9a2
Subproject commit 4179cad611151d2b66da3fc87cebcb5317779cb2

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,2 +0,0 @@
{# The data is already sent as HTML, so we return only the HTML data. Devs don't need a pretty mail... #}
{{ error }}

View File

@ -1,7 +0,0 @@
Une erreur est survenue dans la Note Kfet. Les détails sont ci-dessous.
Cordialement,
L'équipe de la Note Kfet.
{{ error }}