ó |X Tc@stddlmZddlmZmZddlmZejƒZej ƒd„ƒZ dej fd„ƒYZ dS(iÿÿÿÿ(ttemplate(tresolve_variabletNodeList(tGroupcCs˜y|jƒ\}}Wn tk r8tjdƒ‚nX|jdƒ}|jƒ}|jdkr|jdƒ}|jƒn tƒ}t |||ƒS(ss Check to see if the currently logged in user belongs to a specific group. Requires the Django authentication contrib app and middleware. Usage: {% ifusergroup Admins %} ... {% endifusergroup %}, or {% ifusergroup Admins|Group1|"Group 2" %} ... {% endifusergroup %}, or {% ifusergroup Admins %} ... {% else %} ... {% endifusergroup %} s&Tag 'ifusergroup' requires 1 argument.telsetendifusergroup(selseR(R( tsplit_contentst ValueErrorRtTemplateSyntaxErrortparset next_tokentcontentstdelete_first_tokenRtGroupCheckNode(tparserttokenttagtgroupt nodelist_truetnodelist_false((sP/home/paco/Escritorio/control-suicidios.git/principal/templatetags/extra_tags.pyt ifusergroups     R cBseZd„Zd„ZRS(cCs||_||_||_dS(N(RRR(tselfRRR((sP/home/paco/Escritorio/control-suicidios.git/principal/templatetags/extra_tags.pyt__init__$s  cCsØtd|ƒ}|jƒs+|jj|ƒSxš|jjdƒD]†}|jdƒro|jdƒro|dd!n|}y8tj j d|ƒ|j j ƒkr¬|j j|ƒSWq>tjk rÃq>Xq>W|jj|ƒS(Ntusert|t"iiÿÿÿÿtname(Rtis_authenticatedRtrenderRtsplitt startswithtendswithRtobjectstgettgroupstallRt DoesNotExist(RtcontextRR((sP/home/paco/Escritorio/control-suicidios.git/principal/templatetags/extra_tags.pyR)s 1$(t__name__t __module__RR(((sP/home/paco/Escritorio/control-suicidios.git/principal/templatetags/extra_tags.pyR #s N( tdjangoRtdjango.templateRRtdjango.contrib.auth.modelsRtLibrarytregisterRRtNodeR (((sP/home/paco/Escritorio/control-suicidios.git/principal/templatetags/extra_tags.pyts