equal
deleted
inserted
replaced
444 if email is not None: |
444 if email is not None: |
445 req.create_entity('EmailAddress', address=email, |
445 req.create_entity('EmailAddress', address=email, |
446 reverse_primary_email=user) |
446 reverse_primary_email=user) |
447 user.cw_clear_relation_cache('in_group', 'subject') |
447 user.cw_clear_relation_cache('in_group', 'subject') |
448 if commit: |
448 if commit: |
449 try: |
449 getattr(req, 'cnx', req).commit() |
450 req.commit() # req is a session |
|
451 except AttributeError: |
|
452 req.cnx.commit() |
|
453 return user |
450 return user |
454 |
451 |
455 # other utilities ######################################################### |
452 # other utilities ######################################################### |
456 |
453 |
457 @contextmanager |
454 @contextmanager |