New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty slug input during init crashes manage.py #451

Closed
MacLemon opened this Issue Jun 23, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@MacLemon
Contributor

MacLemon commented Jun 23, 2018

Expected Behavior

manage.py should not crash but come again to request mandatory input.

Current Behavior

When you don't enter anything when prompted for Slug (e.g. "conforg"): then manage.py crashes.

Steps to Reproduce

  1. Follow documentation to setup pretalx development system
  2. When prompted for Slug (e.g. "conforg"): simply press return without entering anything.
  3. Enjoy the Traceback.
  4. There is no step 4.

Context

Trying to get a pretalx dev setup running. But most likely to behave identical for the deployment setup.

It's unclear to me what this slug would be used for. Trying it as a path on the instance 404s. (I thought it would be what is to find the orga login screen under /orga but it's not.

If this is not used yet, maybe don't ask for it?
If it actually is used, make clear to the user that this is mandatory and ask again if no valid input is provided by the user.

Your Environment

  • Version used: pretalx 0.7.1 (actually master)
  • Environment name and version (e.g. Chrome 39, python 3.5): Firefox 60.0.2
  • Operating System and version (desktop or mobile): macOS 10.12.6 on a MacBook Pro
  • Link to your instance, if in production: n/a Local Dev instance.
$ python manage.py init
False
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ ┏━━━━━━━━━━┓  This is pretalx v0.7.1 calling, running in production mode.                              ┃
┃ ┃  ┌─·──╮  ┃                                                                                           ┃
┃ ┃  │  O │  ┃  Settings:                                                                                ┃
┃ ┃  │ ┌──╯  ┃  Read from:                                                                               ┃
┃ ┃  └─┘     ┃  Database:  /Volumes/zbitpit/Repositories/pretalx/pretalx/src/data/db.sqlite3 (sqlite3)   ┃
┃ ┗━━━┯━┯━━━━┛  Logging:   /Volumes/zbitpit/Repositories/pretalx/pretalx/src/data/logs                   ┃
┃     ╰─╯                                                                                                ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

Welcome to pretalx! This is my initialization command, please use it only once.
You can abort this command at any time using C-c, and it will save no data.

Let's get you a user with the right to create new events and access every event on this pretalx instance.
Nickname: maclemon
Password:
Password (again):
Superuser created successfully.

Let's also create a first organiser: This will allow you to invite further people and create events.

Name (e.g. "The Conference Organiser"): The Conference Organiser
Slug (e.g. "conforg"):
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/Volumes/zbitpit/Repositories/pretalx/pretalx/env/lib/python3.6/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
    utility.execute()
  File "/Volumes/zbitpit/Repositories/pretalx/pretalx/env/lib/python3.6/site-packages/django/core/management/__init__.py", line 365, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Volumes/zbitpit/Repositories/pretalx/pretalx/env/lib/python3.6/site-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/Volumes/zbitpit/Repositories/pretalx/pretalx/env/lib/python3.6/site-packages/django/core/management/base.py", line 335, in execute
    output = self.handle(*args, **options)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/contextlib.py", line 52, in inner
    return func(*args, **kwds)
  File "/Volumes/zbitpit/Repositories/pretalx/pretalx/src/pretalx/common/management/commands/init.py", line 35, in handle
    team_url = urljoin(settings.SITE_URL, reverse('orga:organiser.teams.view', kwargs={'organiser': organiser_slug, 'pk': team.pk}))
  File "/Volumes/zbitpit/Repositories/pretalx/pretalx/env/lib/python3.6/site-packages/django/urls/base.py", line 90, in reverse
    return iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs))
  File "/Volumes/zbitpit/Repositories/pretalx/pretalx/env/lib/python3.6/site-packages/django/urls/resolvers.py", line 636, in _reverse_with_prefix
    raise NoReverseMatch(msg)
django.urls.exceptions.NoReverseMatch: Reverse for 'organiser.teams.view' with keyword arguments '{'organiser': '', 'pk': 1}' not found. 1 pattern(s) tried: ['orga/organiser/(?P<organiser>[a-zA-Z0-9.-]+)/teams/(?P<pk>[0-9]+)$']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment