def merge_user(sender, old_user=None, new_user=None, **kwargs): from froide.account.utils import move_ownership from .models import TeamMembership move_ownership( TeamMembership, 'user', old_user, new_user, dupe=('user', 'team') )
def merge_user(sender, old_user=None, new_user=None, **kwargs): from froide.account.utils import move_ownership from .models import PublicBody, ProposedPublicBody mapping = [ (PublicBody, '_created_by'), (PublicBody, '_updated_by'), (ProposedPublicBody, '_created_by'), (ProposedPublicBody, '_updated_by'), ] for model, attr in mapping: move_ownership(model, attr, old_user, new_user)
def merge_user(sender, old_user=None, new_user=None, **kwargs): from froide.account.utils import move_ownership from .models import FoiRequestFollower move_ownership( FoiRequestFollower, 'user', old_user, new_user, dupe=('user', 'request',) ) # FIXME: this will not work in case foirequest signal has # not run yet. Check if order is fix FoiRequestFollower.objects.filter( user=new_user, request__user=new_user ).delete()
def merge_user(sender, old_user=None, new_user=None, **kwargs): from froide.account.utils import move_ownership from .models import (FoiRequest, PublicBodySuggestion, FoiMessage, FoiEvent, FoiProject) mapping = [ (FoiRequest, 'user', None), (PublicBodySuggestion, 'user', None), (FoiMessage, 'sender_user', None), (FoiEvent, 'user', None), (FoiProject, 'user', None), ] for model, attr, dupe in mapping: move_ownership(model, attr, old_user, new_user, dupe=dupe)
def merge_user(sender, old_user=None, new_user=None, **kwargs): from froide.account.utils import move_ownership from .models import ( FoiRequest, PublicBodySuggestion, FoiMessage, FoiEvent, FoiProject ) mapping = [ (FoiRequest, 'user', None), (PublicBodySuggestion, 'user', None), (FoiMessage, 'sender_user', None), (FoiEvent, 'user', None), (FoiProject, 'user', None), ] for model, attr, dupe in mapping: move_ownership(model, attr, old_user, new_user, dupe=dupe)
def merge_user(sender, old_user=None, new_user=None, **kwargs): from froide.account.utils import move_ownership from .models import FeaturedRequest move_ownership(FeaturedRequest, 'user', old_user, new_user)
def merge_user(sender, old_user=None, new_user=None, **kwargs): from froide.account.utils import move_ownership from .models import FeaturedRequest move_ownership(FeaturedRequest, 'user', old_user, new_user)
def merge_user(sender, old_user=None, new_user=None, **kwargs): from froide.account.utils import move_ownership from .models import CampaignPage move_ownership(CampaignPage, 'user', old_user, new_user)
def merge_user(sender, old_user=None, new_user=None, **kwargs): from froide.account.utils import move_ownership from .models import AccessToken move_ownership(AccessToken, 'user', old_user, new_user, dupe=('user', 'purpose'))
def merge_user(sender, old_user=None, new_user=None, **kwargs): from froide.account.utils import move_ownership from .models import Guidance move_ownership(Guidance, 'user', old_user, new_user)
def merge_user(sender, old_user=None, new_user=None, **kwargs): from froide.account.utils import move_ownership from .models import Guidance move_ownership(Guidance, 'user', old_user, new_user)