Ali Afshar avatar Ali Afshar committed 844a1a7

Fix senders to be the app to prevent multiple insanities.

Comments (0)

Files changed (1)


 from collections import namedtuple
-from flask import g, session
+from flask import g, session, current_app
 from flask.signals import Namespace
     def login_view(req):
         username = req.form.get('username')
         # check the credentials
-        identity_changed.send('login-view', identity=Identity(username))
+        identity_changed.send(app, identity=Identity(username))
         g.identity = identity
         g.identity = AnonymousIdentity()
-    identity_loaded.send(g.identity, identity=g.identity)
+    identity_loaded.send(current_app._get_current_object(), identity=g.identity)
 def _on_before_request():
-    identity_changed.connect(_on_identity_changed)
+    identity_changed.connect(_on_identity_changed, app)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.