def METHOD_NAME(self, request, problem_instance, form_data, **kwargs):
    submission = super(TeamsMixinForContestController, self).METHOD_NAME(
        request, problem_instance, form_data, **kwargs
    )
    if not is_contest_admin:
        try:
            tm = TeamMembership.objects.get(
                user=request.user, team__contest=request.contest
            )
            submission.user = tm.team.user
            submission.save()
        except TeamMembership.DoesNotExist:
            pass
    return submission