mirror of
https://github.com/almet/copanier.git
synced 2025-04-28 19:42:37 +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:
|
if is_archived:
|
||||||
root = root / "archive"
|
root = root / "archive"
|
||||||
for path in root.glob("*.yml"):
|
for path in root.glob("*.yml"):
|
||||||
id = str(path.relative_to(cls.get_root()))[:-4]
|
id_ = str(path.relative_to(cls.get_root())).replace(".yml", "")
|
||||||
yield Delivery.load(id)
|
yield Delivery.load(id_)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def incoming(cls):
|
def incoming(cls):
|
||||||
|
@ -265,7 +265,9 @@ class Delivery(Base):
|
||||||
|
|
||||||
def unarchive(self):
|
def unarchive(self):
|
||||||
if not self.is_archived:
|
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
|
current = self.path
|
||||||
self.id = self.path.stem
|
self.id = self.path.stem
|
||||||
current.rename(self.path)
|
current.rename(self.path)
|
||||||
|
|
Loading…
Reference in a new issue