The complete() function in [users/views.py] (https://github.com/cytoscape/appstore/blob/master/users/views.py) references two symbols — _do_login and REDIRECT_FIELD_NAME — that are never imported or defined anywhere in the file. This will raise a NameError at runtime.
Affected Code :-

Both _do_login and REDIRECT_FIELD_NAME are used but never imported at the top of the file.
Impact -
-
Severity: High
-
The login_done() view (line 31) calls complete() or authenticated users. Any already-logged-in user who hits the OAuth callback will trigger this code path, resulting in a 500 Internal Server Error.
-
Unauthenticated users are unaffected because they take a different branch in login_done().
Steps to Reproduce :-
- Log in to the App Store as any user.
- Initiate an OAuth login flow again (e.g., click "Sign in with Google" while already authenticated).
- The server returns a 500 error due to NameError: name '_do_login' is not defined.
Proposed Fix
Add the missing imports to the top of users/views.py :-
I'd be happy to submit a PR for this fix.