Skip to content

Commit

Permalink
11650 simple fix to avoid extra hits on the db (#11658)
Browse files Browse the repository at this point in the history
(cherry picked from commit 65ce680)
  • Loading branch information
jdotcms authored and jgambarios committed May 19, 2017
1 parent e2ad28d commit f451d24
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public void configure(final GsonBuilder gsonBuilder) {

gsonBuilder.registerTypeAdapter( Payload.class, new PayloadAdapter() );
gsonBuilder.registerTypeAdapter(ExcludeOwnerVerifierBean.class, new ExcludeOwnerVerifierAdapter());
gsonBuilder.registerTypeAdapter(Contentlet.class, new ContentletDeserializer() );
gsonBuilder.registerTypeAdapter(Contentlet.class, new ContentletDeserializer() ); // todo: for 4.2 use just one instance for all of them.
gsonBuilder.registerTypeAdapter(HTMLPageAsset.class, new ContentletDeserializer() );
gsonBuilder.registerTypeAdapter(Host.class, new ContentletDeserializer() );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ protected boolean doesUserHaveRole(User user, Role role) throws DotDataException
@Override
protected List<String> loadLayoutIdsForRole(Role role) throws DotDataException {
List<String> layouts = rc.getLayoutsForRole(role.getId());
if(layouts == null || layouts.isEmpty()){
if(layouts == null){
layouts = new ArrayList<String>();
HibernateUtil hu = new HibernateUtil(Role.class);
hu.setQuery("from " + LayoutsRoles.class.getName() + " where role_id = ?");
Expand Down

0 comments on commit f451d24

Please sign in to comment.