(self, data, extra=None)
| 255 | return 'general' |
| 256 | |
| 257 | def load_record_data(self, data, extra=None): |
| 258 | self.title = sanitize_str_field_value(data.get('title')).strip() |
| 259 | self.login = sanitize_str_field_value(data.get('secret1')).strip() |
| 260 | self.password = sanitize_str_field_value(data.get('secret2')) |
| 261 | self.link = sanitize_str_field_value(data.get('link')) |
| 262 | self.notes = sanitize_str_field_value(data.get('notes')) |
| 263 | custom = data.get('custom') |
| 264 | if isinstance(custom, list): |
| 265 | self.custom.extend((CustomField(x) for x in custom if isinstance(x, dict) and 'name' in x)) |
| 266 | if isinstance(extra, dict): |
| 267 | if 'files' in extra: |
| 268 | self.attachments = [AttachmentFile(x) for x in extra['files']] |
| 269 | |
| 270 | if 'fields' in extra and isinstance(extra['fields'], list): |
| 271 | self.totp = next((x.get('data', '') for x in extra['fields'] if x.get('field_type') == 'totp'), '') |
| 272 | |
| 273 | def enumerate_fields(self): |
| 274 | # type: () -> Iterable[Tuple[str, Union[None, str, List[str]]]] |
nothing calls this directly
no test coverage detected