<s> from django . conf import settings <EOL> from django . core . exceptions import ImproperlyConfigured <EOL> def get_usersettings_model ( ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> from django . apps import apps <EOL> get_model = apps . get_model <EOL> except ImportError : <EOL> from django . db . models . loading import get_model <EOL> try : <EOL> app_label , model_name = settings . USERSETTINGS_MODEL . split ( '<STR_LIT:.>' ) <EOL> except ValueError : <EOL> raise ImproperlyConfigured ( '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> usersettings_model = get_model ( app_label , model_name ) <EOL> if usersettings_model is None : <EOL> raise ImproperlyConfigured ( '<STR_LIT>' <EOL> '<STR_LIT>' % settings . USERSETTINGS_MODEL ) <EOL> return usersettings_model <EOL> def get_current_usersettings ( ) : <EOL> """<STR_LIT>""" <EOL> USERSETTINGS_MODEL = get_usersettings_model ( ) <EOL> try : <EOL> current_usersettings = USERSETTINGS_MODEL . objects . get_current ( ) <EOL> except USERSETTINGS_MODEL . DoesNotExist : <EOL> current_usersettings = USERSETTINGS_MODEL . get_default ( ) <EOL> return current_usersettings </s>
