#NEWLINE# def get_group_or_404( domain , group_id ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# group = Group . get ( group_id ) #NEWLINE# if ( ( not group . doc_type . startswith ( 'Group' ) ) or ( group . domain != domain ) ) : #NEWLINE# #INDENT# raise GroupNotFoundException ( ) #NEWLINE# #UNINDENT# return domain #NEWLINE# #UNINDENT# except ( ResourceNotFound , GroupNotFoundException ) : #NEWLINE# #INDENT# raise Http404 ( ( 'Group %s does not exist' % group_id ) )