(record, new_field_dict)
| 111 | |
| 112 | |
| 113 | def update_custom_text_fields(record, new_field_dict): |
| 114 | fld_attr = plugin_manager.get_custom_field_attr(record) |
| 115 | for f in record.custom: |
| 116 | field_name = getattr(f, fld_attr) |
| 117 | if field_name in new_field_dict: |
| 118 | if isinstance(record, TypedRecord): |
| 119 | f.value[0] = new_field_dict.pop(field_name) |
| 120 | elif isinstance(record, PasswordRecord): |
| 121 | f.value = new_field_dict.pop(field_name) |
| 122 | for k, v in new_field_dict.items(): |
| 123 | if isinstance(record, TypedRecord): |
| 124 | record.custom.append(TypedField({'type': 'text', 'label': k, 'value': [v]})) |
| 125 | elif isinstance(record, PasswordRecord): |
| 126 | record.custom.append(CustomField({'type': 'text', 'name': k, 'value': v})) |
| 127 | |
| 128 | |
| 129 | def update_password(params, record, new_password, plugin): |
no test coverage detected