Skip to content

Commit

Permalink
Fix #15
Browse files Browse the repository at this point in the history
  • Loading branch information
aitormagan committed Mar 17, 2017
1 parent e9aeee6 commit ce62938
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ckanext/datarequests/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
# You should have received a copy of the GNU Affero General Public License
# along with CKAN Data Requests Extension. If not, see <http://www.gnu.org/licenses/>.

import ckan.model as model

import constants
import sqlalchemy as sa
import uuid
Expand All @@ -32,6 +34,8 @@ def uuid4():
return str(uuid.uuid4())


# TODO: Remove this init_db function and let the classes to be initialized once the script is imported
# Note: Tests have to be changed and calls to init_db from the actions module have to be deleted
def init_db(model):

global DataRequest
Expand Down Expand Up @@ -141,3 +145,5 @@ def get_datarequest_comments_number(cls, **kw):
comments_table.create(checkfirst=True)

model.meta.mapper(Comment, comments_table,)

init_db(model)

0 comments on commit ce62938

Please sign in to comment.