Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
harminius committed Nov 12, 2024
1 parent 0f6ce55 commit 199c316
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 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)
db.session.flush()
pa = ProjectAccess(p, public=request.json.get("public", False))

Expand Down Expand Up @@ -229,7 +230,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 @@ -1182,6 +1182,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 @@ -1207,7 +1208,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

0 comments on commit 199c316

Please sign in to comment.