def _make_editable_files(editable, files):
    if not files:
        return []
    editable_files = [
        EditingRevisionFile(file=file, file_type=file_type)
        for file_type, file_list in files.items() for file in file_list
    ]
    for ef in editable_files:
        ef.file.claim()
    return editable_files
Esempio n. 2
0
def _make_editable_files(editable, files):
    if not files:
        return []
    editable_files = [
        EditingRevisionFile(file=file, file_type=file_type)
        for file_type, file_list in files.viewitems() for file in file_list
    ]
    for ef in editable_files:
        ef.file.claim(contrib_id=editable.contribution.id,
                      editable_type=editable.type.name)
    return editable_files