parameters: (request, user_id, group_name)
return_statement: return render(request, 'user_management/user_delete_confirm.html', context)
docstring: Delete particular user with given group name.
docstring_summary: Delete particular user with given group name.
docstring_tokens: Delete particular user with given group name .
function: def delete_user_in_group(request, user_id, group_name):
      """
          Delete particular user with given group name.
      """
  
      target_user = get_object_or_404(LinkUser, id=user_id)
  
      context = {'target_user': target_user,
                 'action': 'deactivate' if target_user.is_confirmed else 'delete',
                 'this_page': f'users_{group_name}s'}
  
      if request.method == 'POST':
          if target_user.is_confirmed:
              target_user.is_active = False
              target_user.organizations.clear()
              target_user.registrar = None
              target_user.save()
          else:
              target_user.delete()
  
          return HttpResponseRedirect(reverse(f'user_management_manage_{group_name}'))
  
      return render(request, 'user_management/user_delete_confirm.html', context)
function_tokens: def delete_user_in_group ( request , user_id , group_name ) : target_user = get_object_or_404 ( LinkUser , id = user_id ) context = { 'target_user' : target_user , 'action' : 'deactivate' if target_user . is_confirmed else 'delete' , 'this_page' : f'users_{group_name}s' } if request . method == 'POST' : if target_user . is_confirmed : target_user . is_active = False target_user . organizations . clear ( ) target_user . registrar = None target_user . save ( ) else : target_user . delete ( ) return HttpResponseRedirect ( reverse ( f'user_management_manage_{group_name}' ) ) return render ( request , 'user_management/user_delete_confirm.html' , context )