Skip to content

Commit fe08fa3

Browse files
committed
🐛 Fix import for categories
1 parent 7b597e2 commit fe08fa3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

backend/trip/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.8.0"
1+
__version__ = "1.8.1"

backend/trip/routers/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ async def import_data(
9595
raise HTTPException(status_code=400, detail="Invalid file")
9696

9797
for category in data.get("categories", []):
98-
category_name = category.get("category", {}).get("name")
98+
category_name = category.get("name")
9999
category_exists = session.exec(
100100
select(Category).filter(Category.user == current_user, Category.name == category_name)
101101
).first()
@@ -126,7 +126,7 @@ async def import_data(
126126
new_category = Category(**category_data)
127127
session.add(new_category)
128128
session.flush()
129-
session.refresh()
129+
session.refresh(new_category)
130130

131131
places = []
132132
for place in data.get("places", []):

0 commit comments

Comments
 (0)