mirror of
https://github.com/inventree/inventree-app.git
synced 2025-04-28 05:26:47 +00:00
Automatically add a demo server profile (#189)
This commit is contained in:
parent
0165a4bad5
commit
75e0a69eab
@ -190,6 +190,28 @@ class UserProfileDBManager {
|
||||
}
|
||||
}
|
||||
|
||||
// If there are no available profiles, create a demo profile
|
||||
if (profileList.isEmpty) {
|
||||
bool added = await InvenTreeSettingsManager().getBool("demo_profile_added", false);
|
||||
|
||||
// Don't add a new profile if we have added it previously
|
||||
if (!added) {
|
||||
|
||||
await InvenTreeSettingsManager().setValue("demo_profile_added", true);
|
||||
|
||||
UserProfile demoProfile = UserProfile(
|
||||
name: "InvenTree Demo",
|
||||
server: "https://demo.inventree.org",
|
||||
username: "allaccess",
|
||||
password: "nolimits",
|
||||
);
|
||||
|
||||
await addProfile(demoProfile);
|
||||
|
||||
profileList.add(demoProfile);
|
||||
}
|
||||
}
|
||||
|
||||
return profileList;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user