Skip to content
Open
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
4 changes: 3 additions & 1 deletion apps/mainsite/management/commands/seed.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from django.db import connection
from random import randrange
from badgeuser.models import BadgeUser
from mainsite.seeds.util import seed_image_for
from mainsite.models import BadgrApp
from mainsite.tests.base import SetupHelper
from institution.models import Institution, Faculty
from issuer.models import Issuer, BadgeClass, BadgeInstance
Expand All @@ -20,9 +20,11 @@ class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument('-c', '--clean', action='store_true')
parser.add_argument('-as', '--add_assertions', type=int)
parser.add_argument('-cf', '--check_first', action="store_true")

def handle(self, *args, **options):
if not settings.ALLOW_SEEDS:
print('Not seeding: ALLOW_SEEDS is set to false')
return

with override_settings(CACHES={
Expand Down
2 changes: 1 addition & 1 deletion docker/entrypoint-dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ echo "Running migrations"
python ./manage.py migrate

echo "Seeding the database"
python ./manage.py seed -c
python ./manage.py seed --check_first

# Run the server
echo "Starting the server"
Expand Down