mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Moved authentication request state change
This commit is contained in:
parent
13561bdb46
commit
f7bbb243b8
1 changed files with 1 additions and 2 deletions
|
@ -852,7 +852,6 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
|||
url = QUrl("http://" + self._address + self._api_prefix + "auth/request")
|
||||
request = QNetworkRequest(url)
|
||||
request.setHeader(QNetworkRequest.ContentTypeHeader, "application/json")
|
||||
self.setAuthenticationState(AuthState.AuthenticationRequested)
|
||||
self._manager.post(request, json.dumps({"application": "Cura-" + Application.getInstance().getVersion(), "user": self._getUserName()}).encode())
|
||||
|
||||
## Send all material profiles to the printer.
|
||||
|
@ -1033,7 +1032,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
|||
if "/auth/request" in reply_url:
|
||||
# We got a response to requesting authentication.
|
||||
data = json.loads(bytes(reply.readAll()).decode("utf-8"))
|
||||
|
||||
self.setAuthenticationState(AuthState.AuthenticationRequested)
|
||||
global_container_stack = Application.getInstance().getGlobalContainerStack()
|
||||
if global_container_stack: # Remove any old data.
|
||||
Logger.log("d", "Removing old network authentication data as a new one was requested.")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue