equal
deleted
inserted
replaced
477 if email is not None: |
477 if email is not None: |
478 req.create_entity('EmailAddress', address=text_type(email), |
478 req.create_entity('EmailAddress', address=text_type(email), |
479 reverse_primary_email=user) |
479 reverse_primary_email=user) |
480 user.cw_clear_relation_cache('in_group', 'subject') |
480 user.cw_clear_relation_cache('in_group', 'subject') |
481 if commit: |
481 if commit: |
482 try: |
482 getattr(req, 'cnx', req).commit() |
483 req.commit() # req is a session |
|
484 except AttributeError: |
|
485 req.cnx.commit() |
|
486 return user |
483 return user |
487 |
484 |
488 # other utilities ######################################################### |
485 # other utilities ######################################################### |
489 |
486 |
490 @contextmanager |
487 @contextmanager |