Skip to content

Commit

Permalink
[common] Insist on organiser name/slug during init
Browse files Browse the repository at this point in the history
Closes #451
  • Loading branch information
rixx committed Jun 24, 2018
1 parent b480d8d commit 488f73a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions doc/changelog.rst
Expand Up @@ -3,6 +3,7 @@
Release Notes
=============

- :bug:`451` Don't crash during ``pretalx init`` if no conference organiser slug is given.
- :release:`0.7.1 <2018-06-19>`
- :bug:`-` The new read-only links for submissions received the same secret token when migrating the database. No data was leaked as this made using the read-only links impossible. When upgrading to the next release, all read-only link addresses will be reset.
- :bug:`-` A one-character-oversight led to issues with the new navigation search with certain user permissions.
Expand Down
11 changes: 9 additions & 2 deletions src/pretalx/common/management/commands/init.py
Expand Up @@ -11,6 +11,13 @@
from pretalx.person.models import User


def get_nonempty(prompt):
result = input(prompt).strip()
while not result:
result = input(_('This value is required, please enter some value to proceed: '))
return result


class Command(BaseCommand):
help = 'Initializes your pretalx instance. Only to be used once.'

Expand All @@ -26,8 +33,8 @@ def handle(self, *args, **options):

self.stdout.write(_('''\nLet\'s also create a first organiser: This will allow you to invite further people and create events.'''))

organiser_name = input(_('\nName (e.g. "The Conference Organiser"): '))
organiser_slug = input(_('Slug (e.g. "conforg"): '))
organiser_name = get_nonempty(_('\nName (e.g. "The Conference Organiser"): '))
organiser_slug = get_nonempty(_('Slug (e.g. "conforg", used in urls): '))

organiser, team = create_organiser_with_user(name=organiser_name, slug=organiser_slug, user=user)

Expand Down

0 comments on commit 488f73a

Please sign in to comment.