Skip to content

Commit e074ae9

Browse files
author
matthias_schaub
committed
Remove duplicated code.
1 parent 81800a6 commit e074ae9

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

mapswipe_workers/mapswipe_workers/firebase_to_postgres/archive_project.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def chunks(data: list, size: int = 250) -> Iterable[list]:
1616
yield data[i : i + size] # noqa E203
1717

1818

19-
def archive_project(project_ids: list) -> None:
19+
def archive_project(project_ids: list) -> bool:
2020
"""
2121
Archive a project.
2222
@@ -67,14 +67,6 @@ def archive_project(project_ids: list) -> None:
6767
)
6868
ref.delete()
6969

70-
ref = fb_db.reference(f"v2/groups/{project_id}")
71-
if not re.match(r"/v2/\w+/[-a-zA-Z0-9]+", ref.path):
72-
raise CustomError(
73-
f"""Given argument resulted in invalid Firebase Realtime Database reference.
74-
{ref.path}"""
75-
)
76-
ref.delete()
77-
7870
fb_db.reference(f"v2/projects/{project_id}/status").set("archived")
7971

8072
pg_db = auth.postgresDB()

0 commit comments

Comments
 (0)