def METHOD_NAME(category, data, *, _extra_log_fields=None):
    changes = category.populate_from_dict(data)
    db.session.flush()
    signals.category.updated.send(category, changes=changes)
    logger.info('Protection of category %r updated with %r by %r', category, data, session.user)
    if changes:
        log_fields = {'protection_mode': 'Protection mode',
                      'own_no_access_contact': 'No access contact',
                      'visibility': {'title': 'Visibility', 'type': 'string',
                                     'convert': lambda changes: [format_visibility(category, x) for x in changes]},
                      'event_creation_mode': 'Event creation mode',
                      **(_extra_log_fields or {})}
        category.log(CategoryLogRealm.category, LogKind.change, 'Category', 'Protection updated', session.user,
                     data={'Changes': make_diff_log(changes, log_fields)})