Replace ... by …

Signed-off-by: Emmy D'ANELLO <ynerant@crans.org>
This commit is contained in:
Emmy D'ANELLO 2022-08-29 11:17:17 +02:00
parent 86bc2d2698
commit 48d9a8b5d2
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
5 changed files with 14 additions and 14 deletions

View File

@ -50,7 +50,7 @@
* `--bus BUS` : filtre par bus, en récupérant uniquement les inscriptions sur un bus. Par défaut, on affiche * `--bus BUS` : filtre par bus, en récupérant uniquement les inscriptions sur un bus. Par défaut, on affiche
tous les bus. tous les bus.
* `--team TEAM` : filtre par équipe, en récupérant uniquement les inscriptions sur une équipe. Par défaut, on * `--team TEAM` : filtre par équipe, en récupérant uniquement les inscriptions sur une équipe. Par défaut, on
affiche toutes les équipes. Entrer `"none"` filtre les inscriptions sans équipe (chefs de bus, ...) affiche toutes les équipes. Entrer `"none"` filtre les inscriptions sans équipe (chefs de bus,)
* `--sep` : définit le caractère de séparation des colonnes du fichier CSV. Par défaut, il s'agit du caractère `|`. * `--sep` : définit le caractère de séparation des colonnes du fichier CSV. Par défaut, il s'agit du caractère `|`.
Merci de ne pas rentrer plus d'un caractère. Merci de ne pas rentrer plus d'un caractère.

View File

@ -57,13 +57,13 @@ class Command(BaseCommand):
if user_id.isnumeric(): if user_id.isnumeric():
qs = User.objects.filter(pk=int(user_id)) qs = User.objects.filter(pk=int(user_id))
if not qs.exists(): if not qs.exists():
self.stderr.write(self.style.WARNING(f"User {user_id} was not found. Ignoring...")) self.stderr.write(self.style.WARNING(f"User {user_id} was not found. Ignoring"))
continue continue
user = qs.get() user = qs.get()
else: else:
qs = Alias.objects.filter(normalized_name=Alias.normalize(user_id), note__noteuser__isnull=False) qs = Alias.objects.filter(normalized_name=Alias.normalize(user_id), note__noteuser__isnull=False)
if not qs.exists(): if not qs.exists():
self.stderr.write(self.style.WARNING(f"User {user_id} was not found. Ignoring...")) self.stderr.write(self.style.WARNING(f"User {user_id} was not found. Ignoring"))
continue continue
user = qs.get().note.user user = qs.get().note.user
@ -80,7 +80,7 @@ class Command(BaseCommand):
local_deleted += list(transactions) local_deleted += list(transactions)
for tr in transactions: for tr in transactions:
if kwargs['verbosity'] >= 1: if kwargs['verbosity'] >= 1:
self.stdout.write(f"Removing {tr}...") self.stdout.write(f"Removing {tr}")
if force: if force:
tr.delete() tr.delete()
@ -89,7 +89,7 @@ class Command(BaseCommand):
local_deleted += list(memberships) local_deleted += list(memberships)
if kwargs['verbosity'] >= 1: if kwargs['verbosity'] >= 1:
for membership in memberships: for membership in memberships:
self.stdout.write(f"Removing {membership}...") self.stdout.write(f"Removing {membership}")
if force: if force:
memberships.delete() memberships.delete()
@ -98,7 +98,7 @@ class Command(BaseCommand):
local_deleted += list(alias_set) local_deleted += list(alias_set)
if kwargs['verbosity'] >= 1: if kwargs['verbosity'] >= 1:
for alias in alias_set: for alias in alias_set:
self.stdout.write(f"Removing alias {alias}...") self.stdout.write(f"Removing alias {alias}")
if force: if force:
alias_set.delete() alias_set.delete()
@ -110,7 +110,7 @@ class Command(BaseCommand):
local_deleted += list(entries) local_deleted += list(entries)
if kwargs['verbosity'] >= 1: if kwargs['verbosity'] >= 1:
for entry in entries: for entry in entries:
self.stdout.write(f"Removing {entry}...") self.stdout.write(f"Removing {entry}")
if force: if force:
entries.delete() entries.delete()
@ -119,7 +119,7 @@ class Command(BaseCommand):
local_deleted += list(guests) local_deleted += list(guests)
if kwargs['verbosity'] >= 1: if kwargs['verbosity'] >= 1:
for guest in guests: for guest in guests:
self.stdout.write(f"Removing guest {guest}...") self.stdout.write(f"Removing guest {guest}")
if force: if force:
guests.delete() guests.delete()
@ -131,7 +131,7 @@ class Command(BaseCommand):
local_deleted += list(credits) local_deleted += list(credits)
if kwargs['verbosity'] >= 1: if kwargs['verbosity'] >= 1:
for credit in credits: for credit in credits:
self.stdout.write(f"Removing {credit}...") self.stdout.write(f"Removing {credit}")
if force: if force:
credits.delete() credits.delete()

View File

@ -214,7 +214,7 @@ class Command(ImportCommand):
pk_alias = Alias.objects.order_by('-id').first().id + 1 pk_alias = Alias.objects.order_by('-id').first().id + 1
for idx, row in enumerate(cur): for idx, row in enumerate(cur):
alias_name = row["alias"] alias_name = row["alias"]
alias_name = (alias_name[:252] + '...') if len(alias_name) > 255 else alias_name alias_name = (alias_name[:254] + '') if len(alias_name) > 255 else alias_name
alias_norm = Alias.normalize(alias_name) alias_norm = Alias.normalize(alias_name)
self.update_line(idx, n, alias_norm) self.update_line(idx, n, alias_norm)
# clean pseudo (normalized pseudo must be unique) # clean pseudo (normalized pseudo must be unique)

View File

@ -102,7 +102,7 @@ class Command(ImportCommand):
def _basic_transaction(self, row, obj_dict, child_dict): def _basic_transaction(self, row, obj_dict, child_dict):
if len(row["description"]) > 255: if len(row["description"]) > 255:
obj_dict["reason"] = obj_dict["reason"][:250] + "...)" obj_dict["reason"] = obj_dict["reason"][:252] + ")"
return obj_dict, None, None return obj_dict, None, None
def _template_transaction(self, row, obj_dict, child_dict): def _template_transaction(self, row, obj_dict, child_dict):
@ -221,7 +221,7 @@ class Command(ImportCommand):
"valid": row["valide"], "valid": row["valide"],
} }
if len(obj_dict["reason"]) > 255: if len(obj_dict["reason"]) > 255:
obj_dict["reason"] = obj_dict["reason"][:252] + "..." obj_dict["reason"] = obj_dict["reason"][:254] + ""
# for child transaction Models # for child transaction Models
child_dict = {"pk": pk_transaction} child_dict = {"pk": pk_transaction}
ttype = row["type"] ttype = row["type"]

View File

@ -17,10 +17,10 @@ class Command(BaseCommand):
user.is_active = True user.is_active = True
if kwargs['STAFF']: if kwargs['STAFF']:
if kwargs['verbosity'] > 0: if kwargs['verbosity'] > 0:
self.stdout.write(f"Add {user} to staff users...") self.stdout.write(f"Add {user} to staff users")
user.is_staff = True user.is_staff = True
if kwargs['SUPER']: if kwargs['SUPER']:
if kwargs['verbosity'] > 0: if kwargs['verbosity'] > 0:
self.stdout.write(f"Add {user} to superusers...") self.stdout.write(f"Add {user} to superusers")
user.is_superuser = True user.is_superuser = True
user.save() user.save()