Comments (4)
yes, i think that's intentional as the method is a skeleton meant to be filled with merging logic depending on the final app. see discussion in #62
from gae-init.
yep it's intentional.. as some people might want to do something extra after the merge to the given user_db
..
from gae-init.
maybe we could update the comment so it's a bit clearer that this is not a left TODO for us but for the developer using gae-init?
# TODO: if you want to handle user data for merged users, do it here!
from gae-init.
it is not obvious... maybe something like this
def merge_user_dbs(deprecated_keys, user_db=None, post_func=lambda u: u):
deprecated_dbs = ndb.get_multi(deprecated_keys)
for deprecated_db in deprecated_dbs:
deprecated_db.auth_ids = []
deprecated_db.active = False
if not deprecated_db.username.startswith('_'):
deprecated_db.username = '_%s' % deprecated_db.username
ndb.put_multi(deprecated_dbs)
post_func(user_db)
usage by default
deprecated_keys = [key for key in user_db_keys if key != merged_user_db.key]
merge_user_dbs(deprecated_keys)
with extra something
deprecated_keys = [key for key in user_db_keys if key != merged_user_db.key]
merge_user_dbs(deprecated_keys, merged_user_db, lambda u: u.key.delete())
or
def something(user):
user.key.delete()
deprecated_keys = [key for key in user_db_keys if key != merged_user_db.key]
merge_user_dbs(deprecated_keys, merged_user_db, something)
from gae-init.
Related Issues (20)
- Google login is not working (not GAE) HOT 1
- AttributeError: 'module' object has no attribute 'get_dbs'
- gulp-help is a blocker to upgrading to gulp4 HOT 2
- Yarn doesn't work with Node v12 HOT 3
- Use of memcache is a blocker to Python 3.7 migration HOT 5
- Trouble running gulp for local testing with grpcio in app.yaml HOT 4
- Can't import numpy HOT 7
- Error with virtualenv unrecognized argument during yarn install
- Requirement for email_validator on local test run not satisfied? HOT 4
- Race condition in deploy vs creation of lib.zip HOT 2
- Inconsistencies in gulpfile task descriptions HOT 3
- Add Twitch Login
- Upgrade to Font Awesome 5
- plan to update to python 3? HOT 1
- Moment.js is a legacy project HOT 1
- Dependabot couldn't authenticate with https://pypi.python.org/simple/
- Import error with latest changes HOT 1
- Travis not running
- Improve cleanup in development HOT 1
- gae-init.appspot.com is down
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gae-init.