def remove_core_from_club( request, **kwargs ): core = get_object_or_404( User, pk = kwargs['core'] ) project = get_object_or_404( Project, pk = kwargs['project'] ) if( (not PermissionHandler.remove_core_from_club( request.user, **kwargs )) ): # check for permission using the permissions module. dajax = Dajax() dajax.alert('You do NOT have this permission') return dajax.json() if core in club.cores.all(): club.cores.remove( core ) else: raise ValueError('User does not belong to this club') dajax = Dajax() dajax.script('location.reload(true)') return dajax.json()