Example #1
0
 def press_yes_delete_user(self):
     user = User.get_by_rfid(self.user)['data']
     deleted = User.delete(user)
     if deleted['data'] is True:
         self.info = InfoWindow(label_text=u'Користувача видалено',
                                parent=self,
                                previous_parent=self.parent)
         self.info.show()
         QtCore.QTimer.singleShot(5000, self.info.close)
         QtCore.QTimer.singleShot(5000, self.close)
         QtCore.QTimer.singleShot(5000, self.parent.close)
     else:
         self.info = InfoWindow(
             label_text=
             u'Вибачте, сталася помилка,зверніться будь ласка до адміністратора'
         )
         self.info.show()
         QtCore.QTimer.singleShot(5000, self.info.close)
         QtCore.QTimer.singleShot(5000, self.close)
         QtCore.QTimer.singleShot(5000, self.parent.close)
Example #2
0
 def press_yes_delete_key(self):
     key = Key.get_by_rfid(self.key)['data']
     status = key.status
     deleted = User.delete(key)
     if deleted['data'] is True:
         self.info = InfoWindow(label_text=u'Ключ видалено',
                                parent=self,
                                previous_parent=self.parent)
         self.info.show()
         if status is True:
             return True
             # TODO: start returning keys in keys in box
         QtCore.QTimer.singleShot(5000, self.info.close)
         QtCore.QTimer.singleShot(5000, self.close)
         QtCore.QTimer.singleShot(5000, self.parent.close)
     else:
         self.info = InfoWindow(
             label_text=
             u'Вибачте, сталася помилка,зверніться будь ласка до адміністратора'
         )
         self.info.show()
         QtCore.QTimer.singleShot(5000, self.info.close)
         QtCore.QTimer.singleShot(5000, self.close)
         QtCore.QTimer.singleShot(5000, self.parent.close)