Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix storage restore format #2485

Merged
merged 1 commit into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion apps/auth/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ def authenticate(self, document):

def on_create(self, docs):
# Clear the session data when creating a new session
flask.session.pop("session_token", None)
if flask.session:
flask.session.pop("session_token", None)
for doc in docs:
user = self.authenticate(doc)
if not user:
Expand Down
8 changes: 4 additions & 4 deletions superdesk/commands/data_manipulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def get_dest_path(dest: Union[Path, str], dump: bool = True) -> Path:
base / dest.with_suffix(".json"),
):
if test_path.exists():
return test_path.resolve()
return test_path
raise ValueError(f"There is no {'dump' if dump else 'record'} at {dest}.")


Expand Down Expand Up @@ -404,7 +404,7 @@ def run(
dump_msg = "dumping {name} ({idx}/{total})"
metadata = {
"started": now,
"executable": sys.executable,
"description": "",
}
if description:
metadata["description"] = description
Expand Down Expand Up @@ -575,7 +575,7 @@ def run(
version = tuple(int(v) for v in pymongo.cx.server_info()["version"].split("."))
if version < (4, 0):
raise NotImplementedError("You need to use MongoDB version 4.0 or above to use the record feature")
metadata = {"started": now, "executable": sys.executable, "applied_updates": applied_updates}
metadata = {"started": now, "applied_updates": applied_updates}
if base_dump is not None:
# base dump may be the direct path of the dump to load…
base_dump_p = get_dest_path(base_dump)
Expand Down Expand Up @@ -660,7 +660,7 @@ def run(self, record_file: Union[Path, str], force_db_reset: bool = False, skip_
if skip_base_dump:
print(f"{INFO} skipping base dump restoration as requested")
else:
base_dump_p = Path(base_dump)
base_dump_p = get_dest_path(base_dump, dump=True)
if not base_dump_p.exists():
raise ValueError(f"There is no database dump at {base_dump_p}")
if not force_db_reset:
Expand Down
Loading