Skip to content
This repository has been archived by the owner on Oct 1, 2020. It is now read-only.

Why register a blueprint in case of conflic? #284

Closed
rturk opened this issue Aug 8, 2015 · 2 comments
Closed

Why register a blueprint in case of conflic? #284

rturk opened this issue Aug 8, 2015 · 2 comments
Labels

Comments

@rturk
Copy link

rturk commented Aug 8, 2015

I'm having a hard time trying to understand why quokka/quokka/ext/blueprints.py will register a duplicated Blueprint? This could be hell in case circular imports.

if blueprint.name not in app.blueprints:
    app.register_blueprint(blueprint)
else:
    blueprint.name += str(random.getrandbits(8))
    app.register_blueprint(blueprint)
    logger.warning("CONFLICT:%s already registered, using %s",fname,blueprint.name)

Why the second register "app.register_blueprint(blueprint)" in the else block? Shouldn't be nothing since Blueprint is already registered?

@rturk rturk added the question label Aug 8, 2015
@rochacbruno
Copy link
Collaborator

This was done because of a problem in flask-admin, once we move to the new Flask_admin this can be removed. also there will be #151

rochacbruno added a commit that referenced this issue Dec 5, 2015
@rochacbruno
Copy link
Collaborator

Fixed!!! implemented namespaces for blueprints and urls. no more conflicts

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants