134 valid = ( |
134 valid = ( |
135 len(self.certificatesTree.selectedItems()) > 0 and |
135 len(self.certificatesTree.selectedItems()) > 0 and |
136 self.certificatesTree.selectedItems()[0].parent() is not None |
136 self.certificatesTree.selectedItems()[0].parent() is not None |
137 ) |
137 ) |
138 |
138 |
139 if valid: |
139 certificate = ( |
140 certificate = QSslCertificate.fromData( |
140 QSslCertificate.fromData( |
141 self.certificatesTree.selectedItems()[0].data( |
141 self.certificatesTree.selectedItems()[0].data( |
142 0, self.CertRole)) |
142 0, self.CertRole)) |
143 else: |
143 if valid else |
144 certificate = None |
144 None |
|
145 ) |
145 |
146 |
146 return certificate |
147 return certificate |