mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-11 09:41:40 -05:00
Fix non-selfhosted users export and import
This commit is contained in:
parent
2e46069fcc
commit
bf199de2a0
3 changed files with 5 additions and 5 deletions
|
|
@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||||
## Fixed
|
## Fixed
|
||||||
|
|
||||||
- Distance on the stats page is now rounded. #1548
|
- Distance on the stats page is now rounded. #1548
|
||||||
|
- Non-selfhosted users can now export and import their account data.
|
||||||
|
|
||||||
|
|
||||||
# [0.30.2] - 2025-07-22
|
# [0.30.2] - 2025-07-22
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class Settings::UsersController < ApplicationController
|
class Settings::UsersController < ApplicationController
|
||||||
before_action :authenticate_self_hosted!
|
before_action :authenticate_self_hosted!, only: [:export, :import]
|
||||||
before_action :authenticate_admin!, except: [:export, :import]
|
before_action :authenticate_admin!, except: [:export, :import]
|
||||||
before_action :authenticate_user!, only: [:export, :import]
|
before_action :authenticate_user!, only: [:export, :import]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,12 +57,12 @@ class Tracks::Generator
|
||||||
|
|
||||||
tracks_created = 0
|
tracks_created = 0
|
||||||
|
|
||||||
segments.each do |segment_data|
|
segments.each do |segment|
|
||||||
track = create_track_from_segment(segment_data)
|
track = create_track_from_segment(segment)
|
||||||
tracks_created += 1 if track
|
tracks_created += 1 if track
|
||||||
end
|
end
|
||||||
|
|
||||||
Rails.logger.info "Generated #{tracks_created} tracks for user #{user.id} in optimized #{mode} mode"
|
Rails.logger.info "Generated #{tracks_created} tracks for user #{user.id} in #{mode} mode"
|
||||||
tracks_created
|
tracks_created
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -188,7 +188,6 @@ class Tracks::Generator
|
||||||
if start_at && end_at
|
if start_at && end_at
|
||||||
[start_at.to_i, end_at.to_i]
|
[start_at.to_i, end_at.to_i]
|
||||||
else
|
else
|
||||||
# Get full range for user
|
|
||||||
first_point = user.tracked_points.order(:timestamp).first
|
first_point = user.tracked_points.order(:timestamp).first
|
||||||
last_point = user.tracked_points.order(:timestamp).last
|
last_point = user.tracked_points.order(:timestamp).last
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue