decidim-verifications 0.32.2 → 0.32.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bc1405e6d6499b3d3ca5d9c7ec4fe23026ce545d26dec39fd139b07b390991c2
4
- data.tar.gz: 9a995e907c52f629723385203e5f747b4401536855d1396ea83a7543a9d40ecc
3
+ metadata.gz: 459a7ed89a5d2383e50303da31ba1bf91cc7f6567315f03144faa22d9aa39bd2
4
+ data.tar.gz: 7b6d1503214ae01842225bac6fdf144c8c3b25229c89679ad981f24bcc234287
5
5
  SHA512:
6
- metadata.gz: 1ebdac29531d1b7a9c9ce4e48b1661f01b5ffeb0869be210680f67c8875ad5c67e6dcad03df47ba0430d836baae2a0831340a87ed8d4cb6bf9c2916004457db1
7
- data.tar.gz: 91a538ab8d8e491ab2359e4e91c0e0cbc88ac0aa512098b177a23ea07f4d760dc00c82f87243c8a4a1b6ba66a2b6d26fe5fada7107db3ecbac7c7748f47aa4f3
6
+ metadata.gz: 87689bb0e05f680cc21e23e0d1b3dff4d8889b6556815d07b218b2e66878c240d9b8999de3658369fd788a9916e27ec53ab5d73dd32b317f3b471d139b159421
7
+ data.tar.gz: 197d41977d574df990da35b22339af4f823294e518a091e28329117c2bf013a288a2a2b154fdfa07dafa57f63978ccf192240c83b05ae696cd962afe545c7ed7
@@ -81,14 +81,18 @@ module Decidim
81
81
  end
82
82
 
83
83
  def create_verification_conflict
84
- authorization = Decidim::Authorization.find_by(unique_id: handler.unique_id)
84
+ # rubocop:disable Decidim/OrganizationScopedFinder -- user: @organization.users scopes the lookup to the current organization
85
+ authorization = Decidim::Authorization.where(user: @organization.users).find_by(unique_id: handler.unique_id)
86
+ # rubocop:enable Decidim/OrganizationScopedFinder
85
87
  return if authorization.blank?
86
88
 
89
+ # rubocop:disable Decidim/OrganizationScopedFinder -- users are scoped to the current organization by the authorization lookup above
87
90
  conflict = Decidim::Verifications::Conflict.find_or_initialize_by(
88
91
  current_user: handler.user,
89
92
  managed_user: authorization.user,
90
93
  unique_id: handler.unique_id
91
94
  )
95
+ # rubocop:enable Decidim/OrganizationScopedFinder
92
96
 
93
97
  conflict.update(times: conflict.times + 1)
94
98
 
@@ -86,6 +86,7 @@ module Decidim
86
86
  end
87
87
 
88
88
  on(:transfer_user) do |authorized_user|
89
+ transfer_onboarding_action(current_user, authorized_user)
89
90
  authorized_user.update(last_sign_in_at: Time.current, deleted_at: nil)
90
91
  sign_out(current_user)
91
92
  sign_in(authorized_user)
@@ -198,11 +199,26 @@ module Decidim
198
199
 
199
200
  private
200
201
 
202
+ # Preserves the pending onboarding action of the transferring session on
203
+ # the user that takes over it, so the onboarding flow resumes the action
204
+ # the visitor was trying to complete (e.g. voting a budget) instead of the
205
+ # transferred user's stale action (e.g. a survey already answered).
206
+ def transfer_onboarding_action(from_user, to_user)
207
+ pending_action = from_user.extended_data[Decidim::OnboardingManager::DATA_KEY]
208
+ return if pending_action.blank?
209
+
210
+ to_user.update(
211
+ extended_data: to_user.extended_data.merge(Decidim::OnboardingManager::DATA_KEY => pending_action)
212
+ )
213
+ end
214
+
201
215
  def authorization
216
+ # rubocop:disable Decidim/OrganizationScopedFinder -- user is current_user, scoped to current_organization
202
217
  @authorization ||= Decidim::Authorization.find_or_initialize_by(
203
218
  user: current_user,
204
219
  name: handler_name
205
220
  )
221
+ # rubocop:enable Decidim/OrganizationScopedFinder
206
222
  end
207
223
  end
208
224
  end
@@ -35,10 +35,12 @@ module Decidim
35
35
  end
36
36
 
37
37
  def load_authorization
38
+ # rubocop:disable Decidim/OrganizationScopedFinder -- user is current_user, scoped to current_organization
38
39
  @authorization = Decidim::Authorization.find_or_initialize_by(
39
40
  user: current_user,
40
41
  name: "csv_census"
41
42
  )
43
+ # rubocop:enable Decidim/OrganizationScopedFinder
42
44
  end
43
45
  end
44
46
  end
@@ -86,10 +86,12 @@ module Decidim
86
86
  end
87
87
 
88
88
  def load_authorization
89
+ # rubocop:disable Decidim/OrganizationScopedFinder -- user is current_user, scoped to current_organization
89
90
  @authorization = Decidim::Authorization.find_or_initialize_by(
90
91
  user: current_user,
91
92
  name: "id_documents"
92
93
  )
94
+ # rubocop:enable Decidim/OrganizationScopedFinder
93
95
  end
94
96
 
95
97
  def verification_type
@@ -70,10 +70,12 @@ module Decidim
70
70
  end
71
71
 
72
72
  def load_authorization
73
+ # rubocop:disable Decidim/OrganizationScopedFinder -- user is current_user, scoped to current_organization
73
74
  @authorization = Decidim::Authorization.find_or_initialize_by(
74
75
  user: current_user,
75
76
  name: "postal_letter"
76
77
  )
78
+ # rubocop:enable Decidim/OrganizationScopedFinder
77
79
  end
78
80
  end
79
81
  end
@@ -79,10 +79,12 @@ module Decidim
79
79
  private
80
80
 
81
81
  def authorization
82
+ # rubocop:disable Decidim/OrganizationScopedFinder -- user is current_user, scoped to current_organization
82
83
  @authorization ||= Decidim::Authorization.find_or_initialize_by(
83
84
  user: current_user,
84
85
  name: "sms"
85
86
  )
87
+ # rubocop:enable Decidim/OrganizationScopedFinder
86
88
  end
87
89
  end
88
90
  end
@@ -10,7 +10,7 @@
10
10
 
11
11
  <% unless using_online? %>
12
12
  <div class="mb-12">
13
- <%= translated_attribute(current_organization.id_documents_explanation_text).html_safe %>
13
+ <%= decidim_sanitize_editor_admin(translated_attribute(current_organization.id_documents_explanation_text)) %>
14
14
  </div>
15
15
  <% end %>
16
16
 
@@ -4,7 +4,7 @@
4
4
  </h1>
5
5
  </div>
6
6
 
7
- <%= translated_attribute(current_organization.id_documents_explanation_text).html_safe unless using_online? %>
7
+ <%= decidim_sanitize_editor_admin(translated_attribute(current_organization.id_documents_explanation_text)) unless using_online? %>
8
8
 
9
9
  <%= decidim_form_for(@form, url: authorization_path) do |form| %>
10
10
  <%= render partial: "form", locals: { form: } %>
@@ -228,6 +228,7 @@ fi-pl:
228
228
  authorizations:
229
229
  new:
230
230
  error: Emme voineet vahvistaa tiliäsi, koska tietojasi ei löytynyt organisaation rekisteristä.
231
+ locked: Liian monta epäonnistunutta yritystä. Yritä myöhemmin uudelleen.
231
232
  success: Tilisi on vahvistettu onnistuneesti.
232
233
  dummy_authorization:
233
234
  extra_explanation:
@@ -253,6 +254,7 @@ fi-pl:
253
254
  confirmations:
254
255
  create:
255
256
  error: Vahvistustiedot eivät täsmää. Yritä uudestaan tai hylkää vahvistus, jolloin käyttäjä voi muuttaa sitä.
257
+ locked: Liian monta epäonnistunutta yritystä. Yritä myöhemmin uudelleen.
256
258
  success: Osallistujan vahvistaminen onnistui.
257
259
  new:
258
260
  reject: Hylkää
@@ -329,6 +331,7 @@ fi-pl:
329
331
  title: Pyydä vahvistuskoodia
330
332
  update:
331
333
  error: Vahvistuskoodi ei vastaa meidän koodiamme. Tarkista uudestaan kirje, jonka olemme lähettäneet sinulle.
334
+ locked: Liian monta epäonnistunutta yritystä. Yritä myöhemmin uudelleen.
332
335
  success: Onnittelut. Käyttäjätilisi vahvistaminen onnistui.
333
336
  sms:
334
337
  authorizations:
@@ -348,6 +351,8 @@ fi-pl:
348
351
  title: Pyydä vahvistuskoodia
349
352
  update:
350
353
  error: Vahvistuskoodi on virheellinen. Tarkista uudestaan tekstiviesti, jonka lähetimme sinulle.
354
+ expired: Vahvistuskoodi on vanhentunut. Pyydä uusi koodi.
355
+ locked: Liian monta epäonnistunutta yritystä. Yritä myöhemmin uudelleen tai pyydä uusi koodi.
351
356
  success: Onnittelut. Käyttäjätilisi vahvistaminen onnistui.
352
357
  errors:
353
358
  messages:
@@ -49,6 +49,7 @@ sk:
49
49
  confirm: Zrušenie autorizácií pred dátumom nie je možné vrátiť späť. Naozaj chcete pokračovať?
50
50
  confirm_all: Zrušenie všetkých autorizácií nie je možné vrátiť späť. Naozaj chcete pokračovať?
51
51
  destroy_nok: Pri rušení autorizácií sa vyskytol problém.
52
+ destroy_ok: Rušenie autorizácií prebieha. Dokončenie môže trvať niekoľko minút.
52
53
  info: Je tu celkovo %{count} overených účastníkov.
53
54
  no_data: Žiadni overení účastníci.
54
55
  title: Zrušenie autorizácií
@@ -227,6 +228,7 @@ sk:
227
228
  authorizations:
228
229
  new:
229
230
  error: Váš účet nebol overený, alebo nie ste v sčítanie organizácie.
231
+ locked: Príliš veľa neúspešných pokusov. Skúste to znova neskôr.
230
232
  success: Účet bol úspešne overený.
231
233
  dummy_authorization:
232
234
  extra_explanation:
@@ -256,6 +258,7 @@ sk:
256
258
  confirmations:
257
259
  create:
258
260
  error: Overenie sa nezhoduje. Skúste to znova alebo overenie zamietnite, aby ho účastník mohol opraviť.
261
+ locked: Príliš veľa neúspešných pokusov. Skúste to znova neskôr.
259
262
  success: Účastník bol úspešne overený.
260
263
  new:
261
264
  reject: Odmietnuť
@@ -332,6 +335,7 @@ sk:
332
335
  title: Požiadajte o overovací kód
333
336
  update:
334
337
  error: Váš overovací kód sa nezhoduje s naším. Prosím, skontrolujte list, ktorý sme vám poslali.
338
+ locked: Príliš veľa neúspešných pokusov. Skúste to znova neskôr.
335
339
  success: Gratulujeme. Boli ste úspešne overení.
336
340
  sms:
337
341
  authorizations:
@@ -351,6 +355,8 @@ sk:
351
355
  title: Požiadajte o overovací kód
352
356
  update:
353
357
  error: Váš overovací kód sa nezhoduje s naším. Prosím, skontrolujte SMS, ktorú sme vám poslali.
358
+ expired: Platnosť overovacieho kódu vypršala. Požiadajte o nový.
359
+ locked: Príliš veľa neúspešných pokusov. Skúste to znova neskôr alebo požiadajte o nový kód.
354
360
  success: Gratulujeme. Boli ste úspešne overení.
355
361
  errors:
356
362
  messages:
@@ -3,7 +3,7 @@
3
3
  $LOAD_PATH.push File.expand_path("lib", __dir__)
4
4
 
5
5
  Gem::Specification.new do |s|
6
- version = "0.32.2"
6
+ version = "0.32.3"
7
7
  s.version = version
8
8
  s.authors = ["David Rodriguez"]
9
9
  s.email = ["deivid.rodriguez@riseup.net"]
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds the decidim-verifications version.
5
5
  module Verifications
6
6
  def self.version
7
- "0.32.2"
7
+ "0.32.3"
8
8
  end
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-verifications
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.32.2
4
+ version: 0.32.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Rodriguez
@@ -15,42 +15,42 @@ dependencies:
15
15
  requirements:
16
16
  - - '='
17
17
  - !ruby/object:Gem::Version
18
- version: 0.32.2
18
+ version: 0.32.3
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - '='
24
24
  - !ruby/object:Gem::Version
25
- version: 0.32.2
25
+ version: 0.32.3
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: decidim-admin
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
30
30
  - - '='
31
31
  - !ruby/object:Gem::Version
32
- version: 0.32.2
32
+ version: 0.32.3
33
33
  type: :development
34
34
  prerelease: false
35
35
  version_requirements: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - '='
38
38
  - !ruby/object:Gem::Version
39
- version: 0.32.2
39
+ version: 0.32.3
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: decidim-dev
42
42
  requirement: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - '='
45
45
  - !ruby/object:Gem::Version
46
- version: 0.32.2
46
+ version: 0.32.3
47
47
  type: :development
48
48
  prerelease: false
49
49
  version_requirements: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - '='
52
52
  - !ruby/object:Gem::Version
53
- version: 0.32.2
53
+ version: 0.32.3
54
54
  description: Several verification methods for your decidim instance
55
55
  email:
56
56
  - deivid.rodriguez@riseup.net