Skip to content
Snippets Groups Projects
Commit b677837a authored by Piotr Gawron's avatar Piotr Gawron
Browse files

lazy initialization issue

parent ab5c882d
No related branches found
No related tags found
2 merge requests!630WIP: Resolve "The privileges of a new user are not saved in some cases",!497Resolve "overlays should be defined per project not per map"
Pipeline #7357 failed
......@@ -322,8 +322,8 @@ public class OverlayRestImpl extends BaseRestImpl {
if (Configuration.ANONYMOUS_LOGIN.equals(user.getLogin())) {
throw new SecurityException("You have no privileges to add overlay");
}
Project project = getProjectService().getProjectByProjectId(projectId, token);
if (project == null) {
Model model = getModelService().getLastModelByProjectId(projectId, token);
if (model == null) {
throw new QueryException("Project with given id doesn't exist");
}
ColorSchemaType colorSchemaType = ColorSchemaType.GENERIC;
......@@ -367,10 +367,10 @@ public class OverlayRestImpl extends BaseRestImpl {
.name(name).user(user)
.colorSchemaType(colorSchemaType)
.directory(".")
.project(project)
.project(model.getProject())
.googleLicenseConsent(googleLicenseConsent.equalsIgnoreCase("true")));
int count = layoutService.getCustomLayouts(project, token, false, user).size();
int count = layoutService.getCustomLayouts(model.getProject(), token, false, user).size();
layout.setOrderIndex(count);
layoutService.updateLayout(layout);
......
......@@ -417,7 +417,7 @@ public class LayoutService implements ILayoutService {
fileEntry.setOwner(params.getUser());
topLayout.setInputData(fileEntry);
topLayout.setDescription(params.getDescription());
params.getProject().addLayout(topLayout);
topLayout.setProject(params.getProject());
topLayout.setCreator(params.getUser());
layoutDao.add(topLayout);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment