Skip to content
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

Update flask_pusher.py #13

Closed
wants to merge 1 commit into from

Conversation

ScriptProdigy
Copy link
Contributor

Only make endpoints if its the first time making them, ignore "AssertionError: View function mapping is overwriting an existing endpoint function: pusher.auth" error.

Sorry about all the updates, these are changes I've made manually for some time now but can't deploy to production like that. If you could do another release <3

Only make endpoints if its the first time making them, ignore "AssertionError: View function mapping is overwriting an existing endpoint function: pusher.auth" error.
@coveralls
Copy link

coveralls commented May 19, 2016

Coverage Status

Coverage decreased (-1.2%) to 97.484% when pulling 1649239 on ScriptProdigy:patch-2 into ab5f06e on iurisilvio:master.

@iurisilvio
Copy link
Owner

Why are you initializing the extension two times with the same app?

Your patch fix the problem, but I'm not sure if it is a bug or if you are using Flask wrong.

def test_call_init_app_again(self):
    pusher = Pusher(self.app)
    pusher = Pusher(self.app)

It raises an AssertionError.

If this solution makes sense, a better solution is to check the app.extensions and does not initialize again if pusher is already there.

@iurisilvio
Copy link
Owner

I prefer to maintain the current behaviour. You must not start the extension more than one time.

@iurisilvio iurisilvio closed this Dec 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants