def model_factory(abstract_class):
    """ Given an abstract class, constructs the model that inherits from this class only if a model
        with the same (app label, model name) was not already in the app registry.
    """
    app_label = abstract_class.Meta.app_label
    model_name = abstract_class.__name__.replace('Abstract', '')

    if not is_model_registered(app_label, model_name):
        return type(str(model_name), (abstract_class, ), {'__module__': __name__, })