Skip to content

Commit

Permalink
Merge pull request #73 from luftdaten-at/duplicate-key-error
Browse files Browse the repository at this point in the history
sensor_community_import_grouped_by_location: set primary key to prima…
  • Loading branch information
n11ik authored Feb 24, 2025
2 parents fab3f7e + 18f2870 commit 171c813
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions code/services/data_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ def sensor_community_import_grouped_by_location(db: Session, data: dict, source:

# create if not exists
if not station:
# creaet station
# create station
station = Station(
# take sensor id as device name
device = row['sensor']['id'],
device = f'{loc.id}_location_id',
firmware = None,
apikey = None,
location_id = loc.id,
Expand Down

0 comments on commit 171c813

Please sign in to comment.