Skip to content

Commit

Permalink
Send ProjectVersion created signal when creating project in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
harminius committed Nov 7, 2024
1 parent 775b7b3 commit 1ce9f6f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion server/mergin/sync/public_api_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from typing import Dict
from urllib.parse import quote
import uuid
from time import time
from datetime import datetime
import psycopg2
from blinker import signal
Expand Down
3 changes: 2 additions & 1 deletion server/mergin/tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from dataclasses import asdict
from datetime import datetime

import pysqlite3
from flask import url_for, current_app
import os
from dateutil.tz import tzlocal
Expand All @@ -21,6 +20,7 @@
from ..sync.models import Project, ProjectAccess, ProjectVersion, FileHistory
from ..sync.files import UploadChanges, ChangesSchema
from ..sync.workspace import GlobalWorkspace
from ..sync.public_api_controller import project_version_created
from .. import db
from . import json_headers, DEFAULT_USER, test_project, test_project_dir, TMP_DIR

Expand Down Expand Up @@ -88,6 +88,7 @@ def create_project(name, workspace, user, **kwargs):
pv = ProjectVersion(p, 0, user.id, changes, "127.0.0.1")
db.session.add(pv)
db.session.commit()
project_version_created.send(pv)

os.makedirs(p.storage.project_dir, exist_ok=True)
return p
Expand Down

0 comments on commit 1ce9f6f

Please sign in to comment.