Beispiel #1
0
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')
    )
Beispiel #2
0
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)
Beispiel #3
0
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()
Beispiel #4
0
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)
Beispiel #5
0
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)
Beispiel #6
0
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)
Beispiel #7
0
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)
Beispiel #8
0
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)
Beispiel #9
0
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'))
Beispiel #10
0
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)
Beispiel #11
0
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)