def delete_users(self):
     users = User.get_all()
     if users['data']:
         self.delete_users_window = DeleteUsersWindow(users['data'])
         self.delete_users_window.show()
     elif users['warnings']:
         self.info = InfoWindow(
             label_text=u"Немає користувачів яких можна видалити")
         self.info.show()
         QtCore.QTimer.singleShot(5000, self.info.close)
     else:
         self.info_error.show()
         QtCore.QTimer.singleShot(5000, self.info_error.close)
Beispiel #2
0
 def get_the_keys(self):
     if User.get_all()['warnings']:
         self.info = InfoWindow(
             label_text=
             u"Перший запуск програми, будь ласка створіть користувача!")
         self.info.show()
         self.new_user = AddNewUser()
         QtCore.QTimer.singleShot(3000, self.info.close)
         QtCore.QTimer.singleShot(3000, self.new_user.show)
     else:
         # TODO: Open window with user auth
         user = User.get_by_rfid("12334")['data']
         #self.authenticate_user()
         username = user.firstname + u' ' + user.lastname
         self.welcome_window(username)
         keys = Key.get_all()
         if keys['errors']:
             self.info_error.show()
             QtCore.QTimer.singleShot(5000, self.info_error.close)
         elif keys['warnings']:
             self.get_key_window(keys=None, user=None)
         else:
             self.get_key_window(keys['data'], user=user)
def read_users(skip: int = 0, limit: int = 100, db: Session = Depends(get_db)):
    return User.get_all(db, skip, limit)