Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(6)  |  Call(6)  |  Derive(0)  |  Import(0)

src/n/u/numericube-twistranet-2.0.0/twistranet/twistapp/models/community.py   numericube-twistranet(Download)
    def can_join(self):
        auth = Account.objects._getAuthenticatedAccount()
        base_auth = auth.has_permission(permissions.can_join, self)
        if not base_auth:
            return self.has_pending_invitation
 
        # Regular checks
        auth = Account.objects._getAuthenticatedAccount()
        return auth.has_permission(permissions.can_leave, self)        
 
    def has_pending_invitation(self):
        """
        True if currently auth user has a pending invitation in this community
        """
        auth = Account.objects._getAuthenticatedAccount()
 
        if not account:
            account = Account.objects._getAuthenticatedAccount()
 
        # Ensure first that account is not already in
        Fails silently is account is not a member of the community.
        """
        auth = Account.objects._getAuthenticatedAccount()
        if not account:
            account = auth