Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Submanager uses wrong app instance #159

Open

Description

@lolsborn

Provided example

def gen_admin(app, **kwargs):
    from myweb.admin import MyAdminApp
    ## easiest but possibly incomplete way to copy your settings
    return MyAdminApp(config=app.config, **kwargs)
sub_manager = Manager(gen_admin)

manager = Manager(MyApp)
manager.add_command("admin", sub_manager)

Issues:

  1. doc shows default commands being used, but the Manager isn't being passed with_default_commands=True, but it doesn't seem to matter as with_default_commands doesn't seem to work anyhow. However, If you call manager.add_default_commands() manually the commands are added to the sub-manager.
  2. Submanagers that are Flask app instances don't end up using the app instance that is provided to the Manager, but the root managers app instance.

Steps to repeat

This is a really basic example, there are a number of ways to set this up, but they all end up with runserver or showUrls returning routes for the app attached to the root manager.

admin_manager = Manager(app=admin_app, usage="Perform commands on admin server")
admin_manager.add_command("runserver", Server())
admin_manager.add_command("spec", ShowUrls())
manager.add_command("admin", admin_manager)

Activity

  1. changed the title [-]Submanager app instance[/-] [+]Submanager uses wrong app instance[/+] on Apr 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions