<s> from django . contrib import auth <EOL> from dddp import THREAD_LOCAL <EOL> from dddp . api import API , Publication <EOL> from dddp . logging import LOGS_NAME <EOL> class ClientVersions ( Publication ) : <EOL> """<STR_LIT>""" <EOL> name = '<STR_LIT>' <EOL> queries = [ ] <EOL> class Logs ( Publication ) : <EOL> name = LOGS_NAME <EOL> users = auth . get_user_model ( ) <EOL> def get_queries ( self ) : <EOL> user_pk = getattr ( THREAD_LOCAL , '<STR_LIT>' , False ) <EOL> if user_pk : <EOL> if self . users . objects . filter ( <EOL> pk = user_pk , <EOL> is_active = True , <EOL> is_superuser = True , <EOL> ) . exists ( ) : <EOL> return [ ] <EOL> raise ValueError ( '<STR_LIT>' ) <EOL> API . register ( [ ClientVersions , Logs ] ) </s>
