Beispiel #1
0
def get_default_status():
    default_status = FileStatus.get_by(name=app.config["DEFAULT_FILE_STATUS"])
    if default_status is None:
        default_status = FileStatus(name=app.config["DEFAULT_FILE_STATUS"],
                                    color="#FFFFFF")
        default_status.save()
    return default_status
Beispiel #2
0
def get_default_status():
    """
    Return default file status to set on a file when it is created.
    """
    default_status = FileStatus.get_by(name=app.config["DEFAULT_FILE_STATUS"])
    if default_status is None:
        default_status = FileStatus(name=app.config["DEFAULT_FILE_STATUS"],
                                    color="#FFFFFF")
        default_status.save()
    return default_status.serialize()