decidim-cleaner 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/app/jobs/decidim/cleaner/clean_inactive_users_job.rb +3 -2
- data/lib/decidim/cleaner/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a54a64e4729007defe0803975b74c3e2d5d6fbcc66d30fc33c4534f79a496205
|
4
|
+
data.tar.gz: b3c8baca2de78e8536509be9d5ea87a96521c8b9376da7f1dd6cef97f211c240
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c69c28fcc394795f6fbef9fd340cc35e4068e25983ba321d262416f8406c1b1b0769fc469fd9ab404203f963b10c8da8c8367f266c535fda771087575a2cddd
|
7
|
+
data.tar.gz: 2d7e6f95b56b232137ae8586d4562e59689f54b301360e3a899c5c25e3de237357c5562b442b96f09c018120d52ec47a717ec36b12aa61f51f713f78da1c3c3f
|
data/README.md
CHANGED
@@ -66,7 +66,7 @@ You can then add to your 'config/sidekiq.yml' file:
|
|
66
66
|
## Available tasks
|
67
67
|
|
68
68
|
- [ ] **Delete inactive users**
|
69
|
-
- Cron task that checks for user accounts where `
|
69
|
+
- Cron task that checks for user accounts where `current_sign_in_at` is superior to environment variable `CLEANER_USER_INACTIVITY_LIMIT`. If true, deletes inactive user from the database.
|
70
70
|
|
71
71
|
- [ ] **Delete old admin logs**
|
72
72
|
- Cron task that checks for admin logs where `created_at` is anterior to the time you configured in the back office. If true, deletes old admin logs from the database.
|
@@ -12,7 +12,8 @@ module Decidim
|
|
12
12
|
send_warning(Decidim::User.where(organization: organization)
|
13
13
|
.not_deleted
|
14
14
|
.where.not(email: "")
|
15
|
-
.where("
|
15
|
+
.where("current_sign_in_at < ?", email_inactive_before_date(organization)))
|
16
|
+
|
16
17
|
delete_user_and_send_email(Decidim::User.where(organization: organization)
|
17
18
|
.not_deleted
|
18
19
|
.where.not(email: "")
|
@@ -31,7 +32,7 @@ module Decidim
|
|
31
32
|
|
32
33
|
def delete_user_and_send_email(users)
|
33
34
|
users.find_each do |user|
|
34
|
-
if user.
|
35
|
+
if user.current_sign_in_at > user.warning_date
|
35
36
|
user.update!(warning_date: nil)
|
36
37
|
Rails.logger.info "User with id #{user.id} has logged in again, warning date reset"
|
37
38
|
next
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decidim-cleaner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Quentinchampenois
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: decidim-core
|