<s> from ionyweb . administration . actions . views import ActionAdminDetailView <EOL> class EntryActionAdminDetailView ( ActionAdminDetailView ) : <EOL> def get_new_form ( self , * args , ** kwargs ) : <EOL> entry_kwargs = self . _get_entry_form_kwargs ( * args , ** kwargs ) <EOL> entry_kwargs . update ( kwargs ) <EOL> return super ( EntryActionAdminDetailView , self ) . get_new_form ( * args , ** entry_kwargs ) <EOL> def get_edit_form ( self , * args , ** kwargs ) : <EOL> entry_kwargs = self . _get_entry_form_kwargs ( * args , ** kwargs ) <EOL> entry_kwargs . update ( kwargs ) <EOL> return super ( EntryActionAdminDetailView , self ) . get_edit_form ( * args , ** entry_kwargs ) <EOL> def _get_entry_form_kwargs ( self , * args , ** kwargs ) : <EOL> try : <EOL> app_obj = kwargs . pop ( '<STR_LIT>' ) <EOL> categories_set = app_obj . categories . all ( ) <EOL> except KeyError : <EOL> categories_set = None <EOL> website = self . request . website <EOL> if self . request . is_superuser : <EOL> authors_set = website . owners . all ( ) <EOL> authors_choices = [ ( author . id , author . email ) for author in authors_set ] <EOL> else : <EOL> authors_choices = [ ( self . request . user . pk , self . request . user . email ) ] <EOL> return { '<STR_LIT>' : categories_set , <EOL> '<STR_LIT>' : authors_choices } </s>
