

def __init__(self, *args, **kwargs):
    user = kwargs.pop('user', None)
    super(ProjectAccessControlForm, self).__init__(*args, **kwargs)
    project = kwargs.get('instance', None)
    outsource_required = False
    if args:
        access_control_initial = args[0]['access_control']
        if ('outsourced_access' == access_control_initial):
            outsource_required = True
    elif project:
        if project.anyone_submit:
            access_control_initial = 'free_for_all'
        elif project.outsource:
            access_control_initial = 'outsourced_access'
            outsource_required = True
        else:
            access_control_initial = 'limited_access'
    self.fields['access_control'].initial = access_control_initial
    self.fields['outsource'].required = outsource_required
    if projects:
        self.fields['outsource'].queryset = Project.objects.for_user(user).exclude(slug=project.slug).only('id', 'name')
    else:
        projects = self.fields['outsource'].queryset.exclude(slug=project.slug).exclude(private=True)
        self.fields['outsource'].queryset = projects
    project_access_control_form_start.send(sender=ProjectAccessControlForm, instance=self, project=project)

dataset/ETHPy150Open rvanlaar/easy-transifex/src/transifex/transifex/projects/forms.py ProjectAccessControlForm.__init__/VarMisuse@154/242 `user`->`projects`