mirror of
https://github.com/almet/copanier.git
synced 2025-04-28 11:32:38 +02:00
Review from @almet
This commit is contained in:
parent
85521846e6
commit
012e746ffd
1 changed files with 5 additions and 3 deletions
|
@ -234,8 +234,8 @@ class Delivery(Base):
|
|||
if is_archived:
|
||||
root = root / "archive"
|
||||
for path in root.glob("*.yml"):
|
||||
id = str(path.relative_to(cls.get_root()))[:-4]
|
||||
yield Delivery.load(id)
|
||||
id_ = str(path.relative_to(cls.get_root())).replace(".yml", "")
|
||||
yield Delivery.load(id_)
|
||||
|
||||
@classmethod
|
||||
def incoming(cls):
|
||||
|
@ -265,7 +265,9 @@ class Delivery(Base):
|
|||
|
||||
def unarchive(self):
|
||||
if not self.is_archived:
|
||||
raise ValueError("La livraison n'est pas archivée")
|
||||
raise ValueError(
|
||||
"Impossible de désarchiver une livraison qui n'est pas archivée"
|
||||
)
|
||||
current = self.path
|
||||
self.id = self.path.stem
|
||||
current.rename(self.path)
|
||||
|
|
Loading…
Reference in a new issue