Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
barisusakli committed Oct 15, 2020
1 parent d89477c commit b295d15
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/webserver.js
Expand Up @@ -8,6 +8,7 @@ var os = require('os');
var nconf = require('nconf');
var express = require('express');
var app = express();
app.renderAsync = util.promisify((tpl, data, callback) => app.render(tpl, data, callback));
var server;
var winston = require('winston');
var async = require('async');
Expand Down Expand Up @@ -116,8 +117,6 @@ function setupExpressApp(app) {
const relativePath = nconf.get('relative_path');
const viewsDir = nconf.get('views_dir');

app.renderAsync = util.promisify((tpl, data, callback) => app.render(tpl, data, callback));

app.engine('tpl', function (filepath, data, next) {
filepath = filepath.replace(/\.tpl$/, '.js');

Expand Down
4 changes: 2 additions & 2 deletions src/widgets/admin.js
@@ -1,6 +1,6 @@
'use strict';

const app = require('../webserver').app;
const webserver = require('../webserver');
const plugins = require('../plugins');
const groups = require('../groups');
const index = require('./index');
Expand Down Expand Up @@ -54,7 +54,7 @@ async function getAvailableWidgets() {
async function renderAdminTemplate() {
const groupsData = await groups.getNonPrivilegeGroups('groups:createtime', 0, -1);
groupsData.sort((a, b) => b.system - a.system);
return await app.renderAsync('admin/partials/widget-settings', { groups: groupsData });
return await webserver.app.renderAsync('admin/partials/widget-settings', { groups: groupsData });
}

function buildTemplatesFromAreas(areas) {
Expand Down

0 comments on commit b295d15

Please sign in to comment.