mumuki-laboratory 9.4.0 → 9.4.1

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: 6779734b260a606db6aeb86ca8d473d6d8f6a39cfb1e3717fe946e22787de491
4
- data.tar.gz: 4b41df8165156fe1dda06d55664930e797b229c4115e347f759f82b7d1087bd5
3
+ metadata.gz: 57bb3a9beabe4c776c88430fb3d6b0f2cc00328da5657f8f4c72bf568cf0d5df
4
+ data.tar.gz: 2375d1c0b8eeda4ac72f71d4b36ed83fc759fc3db1be5db69bb48d331d386aa0
5
5
  SHA512:
6
- metadata.gz: 4d5e81c68b394577ef8ea9066841d67a5bbf1d85347f94c8fe2c60452b46242413acd480542950d743cf405999f67bb9dd3e2fb3578cb2cc244af005c3393d99
7
- data.tar.gz: 525592f332c10d95f00af3a703f38a5d57bbdd1e632d3b8ce6d60e2ca40a91abfca0090421fb60818f268e879c7b09abc4eff255f794e061395ca402e7821c74
6
+ metadata.gz: 81d9b2bc3d633cc66105cd4f9052fb13c170bde9aeffb25878ea5e7e3d62a40c0db3824f6da132c82491d1d914ee869aee35a580ce323aa648845ff3b263929c
7
+ data.tar.gz: ec9fc1503a59f7caccaf5e0fac8f92bc93556ee08538904b8d92f30e8d965868fdf01c30df91594cdd2a2853e2d85229c97845d37e3e9a9b0344948ef84ce947
@@ -1,6 +1,8 @@
1
1
  class ExamAuthorizationRequestsController < ApplicationController
2
2
  def create
3
- authorization_request = ExamAuthorizationRequest.create! authorization_request_params
3
+ authorization_request = ExamAuthorizationRequest.find_or_create_by! create_authorization_request_params do |it|
4
+ it.assign_attributes authorization_request_params
5
+ end
4
6
  current_user.read_notification! authorization_request.exam_registration
5
7
  flash.notice = I18n.t :exam_authorization_request_created
6
8
  redirect_to root_path
@@ -14,6 +16,10 @@ class ExamAuthorizationRequestsController < ApplicationController
14
16
 
15
17
  private
16
18
 
19
+ def create_authorization_request_params
20
+ authorization_request_params.slice :exam_registration_id, :user, :organization
21
+ end
22
+
17
23
  def authorization_request_params
18
24
  params
19
25
  .require(:exam_authorization_request).permit(:exam_id, :exam_registration_id)
@@ -1,5 +1,5 @@
1
1
  module Mumuki
2
2
  module Laboratory
3
- VERSION = '9.4.0'
3
+ VERSION = '9.4.1'
4
4
  end
5
5
  end
@@ -0,0 +1,15 @@
1
+ logger = ::Logger.new(STDOUT)
2
+
3
+ namespace :laboratory do
4
+ namespace :exams do
5
+ task authorize_requests: :environment do
6
+ logger.info "Exam Authorization Requests task"
7
+ ExamRegistration.should_process.find_each do |exam_registration|
8
+ logger.info "Processing exam registration '#{exam_registration.description}'"
9
+ exam_registration.process_requests!
10
+ rescue
11
+ logger.error "Something wrong happened while processing '#{exam_registration.description}'"
12
+ end
13
+ end
14
+ end
15
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumuki-laboratory
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.4.0
4
+ version: 9.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franco Bulgarelli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-04 00:00:00.000000000 Z
11
+ date: 2021-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -755,6 +755,7 @@ files:
755
755
  - lib/mumuki/laboratory/version.rb
756
756
  - lib/tasks/assignments.rake
757
757
  - lib/tasks/events.rake
758
+ - lib/tasks/exams.rake
758
759
  - lib/tasks/messages.rake
759
760
  - lib/tasks/users.rake
760
761
  - public/422.html