<s> from __future__ import unicode_literals <EOL> from django . apps import AppConfig <EOL> from django . contrib . auth import get_user_model <EOL> from django . db . models import signals <EOL> from django_fsm import signals as fsm_signals <EOL> class CoreConfig ( AppConfig ) : <EOL> name = '<STR_LIT>' <EOL> verbose_name = '<STR_LIT>' <EOL> def ready ( self ) : <EOL> from nodeconductor . core import handlers <EOL> from nodeconductor . core . models import StateMixin <EOL> User = get_user_model ( ) <EOL> SshPublicKey = self . get_model ( '<STR_LIT>' ) <EOL> signals . pre_save . connect ( <EOL> handlers . preserve_fields_before_update , <EOL> sender = User , <EOL> dispatch_uid = '<STR_LIT>' , <EOL> ) <EOL> signals . post_save . connect ( <EOL> handlers . create_auth_token , <EOL> sender = User , <EOL> dispatch_uid = '<STR_LIT>' , <EOL> ) <EOL> signals . post_save . connect ( <EOL> handlers . log_user_save , <EOL> sender = User , <EOL> dispatch_uid = '<STR_LIT>' , <EOL> ) <EOL> signals . post_delete . connect ( <EOL> handlers . log_user_delete , <EOL> sender = User , <EOL> dispatch_uid = '<STR_LIT>' , <EOL> ) <EOL> signals . post_save . connect ( <EOL> handlers . log_ssh_key_save , <EOL> sender = SshPublicKey , <EOL> dispatch_uid = '<STR_LIT>' , <EOL> ) <EOL> signals . post_delete . connect ( <EOL> handlers . log_ssh_key_delete , <EOL> sender = SshPublicKey , <EOL> dispatch_uid = '<STR_LIT>' , <EOL> ) <EOL> for index , model in enumerate ( StateMixin . get_all_models ( ) ) : <EOL> fsm_signals . post_transition . connect ( <EOL> handlers . delete_error_message , <EOL> sender = model , <EOL> dispatch_uid = '<STR_LIT>' % ( model . __name__ , index ) , <EOL> ) </s>
