Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into develop-redesign-a…
Browse files Browse the repository at this point in the history
…dmin
  • Loading branch information
MarcelGeo committed Nov 12, 2024
2 parents 61448dc + ee90a3e commit 93d9624
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion server/mergin/sync/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

from .files import (
File,
UploadFile,
UploadChanges,
ChangesSchema,
ProjectFile,
Expand Down
4 changes: 2 additions & 2 deletions server/mergin/sync/public_api_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ def add_project(namespace): # noqa: E501

p = Project(**request.json, creator=current_user, workspace=workspace)
p.updated = datetime.utcnow()
db.session.add(p)
pa = ProjectAccess(p, public=request.json.get("public", False))

template_name = request.json.get("template", None)
Expand Down Expand Up @@ -228,7 +229,6 @@ def add_project(namespace): # noqa: E501
get_device_id(request),
)

db.session.add(p)
db.session.add(pa)
db.session.add(version)
db.session.commit()
Expand Down Expand Up @@ -1181,6 +1181,7 @@ def clone_project(namespace, project_name): # noqa: E501
workspace=ws,
)
p.updated = datetime.utcnow()
db.session.add(p)
pa = ProjectAccess(p, public=False)

try:
Expand All @@ -1206,7 +1207,6 @@ def clone_project(namespace, project_name): # noqa: E501
user_agent,
device_id,
)
db.session.add(p)
db.session.add(pa)
db.session.add(project_version)
db.session.commit()
Expand Down
2 changes: 1 addition & 1 deletion server/mergin/tests/test_project_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
ProjectFilePath,
)
from ..sync.files import ChangesSchema
from ..sync.schemas import ProjectListSchema, ProjectSchema
from ..sync.schemas import ProjectListSchema
from ..sync.utils import generate_checksum, is_versioned_file
from ..auth.models import User, UserProfile

Expand Down
2 changes: 1 addition & 1 deletion server/mergin/tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def create_project(name, workspace, user, **kwargs):

p = Project(**project_params, **kwargs)
p.updated = datetime.utcnow()
db.session.add(p)
db.session.flush()

public = kwargs.get("public", False)
pa = ProjectAccess(p, public)
Expand Down

0 comments on commit 93d9624

Please sign in to comment.