better dummy user creation, dev only

This commit is contained in:
Clinton Roy 2019-11-16 16:35:04 +11:00 committed by Joel Addison
parent a8062255ea
commit 9644af2fe6

View file

@ -1,3 +1,4 @@
from django.contrib.auth.models import User
from django.core.management.base import BaseCommand
from symposion.conference.models import Section, current_conference
@ -15,12 +16,15 @@ class Command(BaseCommand):
def handle(self, *args, **options):
conf = current_conference()
section = Section.objects.filter(conference=conf, slug="main").all().first()
user = User.objects.first()
speaker = Speaker.objects.first()
if not speaker:
speaker, _ = Speaker.objects.get_or_create(name="Dummy Speaker",
defaults={"user": user})
talk_kind = ProposalKind.objects.first()
target_audience = TalkProposal.TARGET_USER
print(talk_kind)
for i in range(1000, 1020):
prop, _created = TalkProposal.objects.get_or_create(
pk=i, kind=talk_kind, speaker=speaker, target_audience=target_audience,