@login_required
@require_http_methods(['POST'])
def make_contributor(request):
 group = Group.objects.get(name=CONTRIBUTOR_GROUP)
 request.user.groups.add(group)
 @email_utils.safe_translation
 def _make_mail(locale):
  mail = email_utils.make_mail(subject=_('Welcome to SUMO!'), text_template='users/email/contributor.ltxt', html_template='users/email/contributor.html', context_vars={'contributor': request.user}, from_email=settings.DEFAULT_FROM_EMAIL, to_email=request.user.email)
  return mail
 email_utils.send_messages([_make_mail(request.LANGUAGE_CODE)])
 if ('return_to' in request.POST):
  return HttpResponseRedirect(request.POST['return_to'])
 else:
  return HttpResponseRedirect(reverse('landings.get_involved'))

@ login_required @ require_http_methods ( [ 'POST' ] ) def make_contributor ( request ) : group = Group . objects . get ( name = CONTRIBUTOR_GROUP ) request . user . groups . add ( group ) @ email_utils . safe_translation def _make_mail ( locale ) : mail = email_utils . make_mail ( subject = _ ( 'Welcome to SUMO!' ) , text_template = 'users/email/contributor.ltxt' , html_template = 'users/email/contributor.html' , context_vars = { 'contributor' : request . user } , from_email = settings . DEFAULT_FROM_EMAIL , to_email = request . user . email ) return mail email_utils . send_messages ( [ _make_mail ( request . LANGUAGE_CODE ) ] ) if ( 'return_to' in request . POST ) : return HttpResponseRedirect ( request . POST [ 'return_to' ] ) else : return HttpResponseRedirect ( reverse ( 'landings.get_involved' ) )
adds the logged in user to the contributor group .