Skip to content

Commit 14bf2e9

Browse files
Anurag Awasthiyadvr
authored andcommitted
ui: Don't pass account name when in project mode (#3435)
When users try to list instances in project mode from Account > SSHKeyPairs > Key > View Instances, we don't need to include sshkeypairs account name into the API Param. It's redundant and causes error. Fixes #2895
1 parent 2ecd5ec commit 14bf2e9

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

ui/scripts/instances.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -750,9 +750,13 @@
750750
if ("sshkeypairs" in args.context) {
751751
$.extend(data, {
752752
domainid: args.context.sshkeypairs[0].domainid,
753-
account: args.context.sshkeypairs[0].account,
754753
keypair: args.context.sshkeypairs[0].name
755754
});
755+
if (!cloudStack.context || !cloudStack.context.projects) {
756+
// In case we are in project mode sshkeypairs provides project account name which
757+
// should not be passed as part of API params. So only extend if NOT in project mode.
758+
$.extend(data, { account: args.context.sshkeypairs[0].account});
759+
}
756760
}
757761

758762
$.ajax({

0 commit comments

Comments
 (0)