(record, new_field_dict)
| 174 | |
| 175 | |
| 176 | def update_custom_text_fields(record, new_field_dict): |
| 177 | fld_attr = plugin_manager.get_custom_field_attr(record) |
| 178 | for f in record.custom: |
| 179 | field_name = getattr(f, fld_attr) |
| 180 | if field_name in new_field_dict: |
| 181 | if isinstance(record, TypedRecord): |
| 182 | f.value[0] = new_field_dict.pop(field_name) |
| 183 | elif isinstance(record, PasswordRecord): |
| 184 | f.value = new_field_dict.pop(field_name) |
| 185 | for k, v in new_field_dict.items(): |
| 186 | if isinstance(record, TypedRecord): |
| 187 | record.custom.append(TypedField({'type': 'text', 'label': k, 'value': [v]})) |
| 188 | elif isinstance(record, PasswordRecord): |
| 189 | record.custom.append(CustomField({'type': 'text', 'name': k, 'value': v})) |
| 190 | |
| 191 | |
| 192 | def update_password(params, record, new_password, plugin): |
no test coverage detected