@require_POST
def toggle_skill_subscription(request, url):
 skill = get_object_or_404(Skill, url=url)
 profile = request.user.userprofile
 if profile.skills.filter(id=skill.id).exists():
  profile.skills.remove(skill)
 else:
  profile.skills.add(skill)
 return redirect(reverse('groups:show_skill', args=[skill.url]))

@ require_POST def toggle_skill_subscription ( request , url ) : skill = get_object_or_404 ( Skill , url = url ) profile = request . user . userprofile if profile . skills . filter ( id = skill . id ) . exists ( ) : profile . skills . remove ( skill ) else : profile . skills . add ( skill ) return redirect ( reverse ( 'groups:show_skill' , args = [ skill . url ] ) )
toggle the current users membership of a group .