Merge pull request #5641 from betagouv/fix-broken-admin-stats
fix for missing user_sign_in_count
This commit is contained in:
commit
dd43c46e5e
1 changed files with 3 additions and 3 deletions
|
@ -27,7 +27,7 @@ class AdministrateurUsageStatisticsService
|
|||
nb_dossiers_roi = nb_dossiers_by_procedure_id.reject { |procedure_id, _count| is_brouillon(procedure_id) }.map { |_procedure_id, count| count }.sum
|
||||
|
||||
result = {
|
||||
ds_sign_in_count: administrateur.user.sign_in_count,
|
||||
ds_sign_in_count: administrateur&.user&.sign_in_count,
|
||||
ds_created_at: administrateur.created_at,
|
||||
ds_active: administrateur.user.active?,
|
||||
ds_id: administrateur.id,
|
||||
|
@ -62,11 +62,11 @@ class AdministrateurUsageStatisticsService
|
|||
admin_roi_high: nb_dossiers_roi * 17
|
||||
}
|
||||
|
||||
if administrateur.user.current_sign_in_at.present?
|
||||
if administrateur&.user&.current_sign_in_at.present?
|
||||
result[:ds_current_sign_in_at] = administrateur.user.current_sign_in_at
|
||||
end
|
||||
|
||||
if administrateur.user.last_sign_in_at.present?
|
||||
if administrateur&.user&.last_sign_in_at.present?
|
||||
result[:ds_last_sign_in_at] = administrateur.user.last_sign_in_at
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue