tweak warning msg
This commit is contained in:
parent
a0a79cead8
commit
6ac48d7c35
2 changed files with 3 additions and 8 deletions
|
@ -4,6 +4,7 @@ from io import StringIO
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import List, Tuple, Iterator
|
from typing import List, Tuple, Iterator
|
||||||
from django.db.models import QuerySet
|
from django.db.models import QuerySet
|
||||||
|
from django.db import transaction
|
||||||
|
|
||||||
from .schema import Link
|
from .schema import Link
|
||||||
from ..util import enforce_types
|
from ..util import enforce_types
|
||||||
|
@ -23,8 +24,6 @@ def parse_sql_main_index(out_dir: Path=OUTPUT_DIR) -> Iterator[Link]:
|
||||||
|
|
||||||
@enforce_types
|
@enforce_types
|
||||||
def remove_from_sql_main_index(snapshots: QuerySet, out_dir: Path=OUTPUT_DIR) -> None:
|
def remove_from_sql_main_index(snapshots: QuerySet, out_dir: Path=OUTPUT_DIR) -> None:
|
||||||
from django.db import transaction
|
|
||||||
|
|
||||||
with transaction.atomic():
|
with transaction.atomic():
|
||||||
snapshots.delete()
|
snapshots.delete()
|
||||||
|
|
||||||
|
@ -49,8 +48,6 @@ def write_link_to_sql_index(link: Link):
|
||||||
|
|
||||||
@enforce_types
|
@enforce_types
|
||||||
def write_sql_main_index(links: List[Link], out_dir: Path=OUTPUT_DIR) -> None:
|
def write_sql_main_index(links: List[Link], out_dir: Path=OUTPUT_DIR) -> None:
|
||||||
from django.db import transaction
|
|
||||||
|
|
||||||
with transaction.atomic():
|
with transaction.atomic():
|
||||||
for link in links:
|
for link in links:
|
||||||
write_link_to_sql_index(link)
|
write_link_to_sql_index(link)
|
||||||
|
@ -59,7 +56,6 @@ def write_sql_main_index(links: List[Link], out_dir: Path=OUTPUT_DIR) -> None:
|
||||||
@enforce_types
|
@enforce_types
|
||||||
def write_sql_link_details(link: Link, out_dir: Path=OUTPUT_DIR) -> None:
|
def write_sql_link_details(link: Link, out_dir: Path=OUTPUT_DIR) -> None:
|
||||||
from core.models import Snapshot
|
from core.models import Snapshot
|
||||||
from django.db import transaction
|
|
||||||
|
|
||||||
with transaction.atomic():
|
with transaction.atomic():
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -8,10 +8,9 @@ if __name__ == '__main__':
|
||||||
# (e.g. makemigrations), you can comment out this check temporarily
|
# (e.g. makemigrations), you can comment out this check temporarily
|
||||||
|
|
||||||
if not ('makemigrations' in sys.argv or 'migrate' in sys.argv):
|
if not ('makemigrations' in sys.argv or 'migrate' in sys.argv):
|
||||||
print("[X] Don't run ./manage.py directly, use the archivebox CLI instead e.g.:")
|
print("[X] Don't run ./manage.py directly (unless you are a developer running makemigrations):")
|
||||||
print(' archivebox manage createsuperuser')
|
|
||||||
print()
|
print()
|
||||||
print(' Hint: Use these archivebox commands instead of the ./manage.py equivalents:')
|
print(' Hint: Use these archivebox CLI commands instead of the ./manage.py equivalents:')
|
||||||
print(' archivebox init (migrates the databse to latest version)')
|
print(' archivebox init (migrates the databse to latest version)')
|
||||||
print(' archivebox server (runs the Django web server)')
|
print(' archivebox server (runs the Django web server)')
|
||||||
print(' archivebox shell (opens an iPython Django shell with all models imported)')
|
print(' archivebox shell (opens an iPython Django shell with all models imported)')
|
||||||
|
|
Loading…
Add table
Reference in a new issue