mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-25 12:14:32 -04:00
fix NOT NULL constraint failed: core_snapshot.created_by_id
This commit is contained in:
parent
b789be098d
commit
6456cb1727
2 changed files with 4 additions and 2 deletions
archivebox/index
|
@ -37,9 +37,11 @@ def remove_from_sql_main_index(snapshots: QuerySet, atomic: bool=False, out_dir:
|
|||
@enforce_types
|
||||
def write_link_to_sql_index(link: Link, created_by_id: int | None=None):
|
||||
from core.models import Snapshot, ArchiveResult
|
||||
from abid_utils.models import get_or_create_system_user_pk
|
||||
|
||||
info = {k: v for k, v in link._asdict().items() if k in Snapshot.keys}
|
||||
|
||||
info['created_by_id'] = created_by_id
|
||||
info['created_by_id'] = created_by_id or get_or_create_system_user_pk()
|
||||
|
||||
tag_list = list(dict.fromkeys(
|
||||
tag.strip() for tag in re.split(TAG_SEPARATOR_PATTERN, link.tags or '')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue