Skip to content

Commit

Permalink
Merge branch 'dev' for release 6.3.33
Browse files Browse the repository at this point in the history
  • Loading branch information
gnepud committed Oct 2, 2024
2 parents 791e188 + 1e74afd commit 71c94bf
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

## Next release

## v6.3.33 2024 October 2

- Fix a bug: unable to reset OpenApi token
- Fix a bug: unable to sync projects with openprojects
- [TODO DEPLOY] `rails fablab:openlab:bulk_export`
- [TODO DEPLOY] `rails fablab:openlab:bulk_update`

## v6.3.32 2024 July 22

- Fix a bug: manager cannot pay a subscription(payment schedule) with a wallet
Expand Down
7 changes: 3 additions & 4 deletions app/models/concerns/openlab_sync.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,17 @@ module OpenlabSync
extend ActiveSupport::Concern

included do
after_create :openlab_create, if: :openlab_sync_active?
after_update :openlab_update, if: :openlab_sync_active?
after_save :openlab_create_or_update, if: :openlab_sync_active?
after_destroy :openlab_destroy, if: :openlab_sync_active?

def openlab_create
OpenlabWorker.perform_in(2.seconds, :create, id) if published?
end

def openlab_update
def openlab_create_or_update
return unless published?

if state_was == 'draft'
if state_was == 'draft' || state_was.nil?
OpenlabWorker.perform_async(:create, id)
else
OpenlabWorker.perform_async(:update, id)
Expand Down
6 changes: 3 additions & 3 deletions app/models/open_api/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
# OpenAPI::Client keeps track of the authorized accesses to the 3-rd party API (aka. OpenAPI)
class OpenAPI::Client < ApplicationRecord
validates :name, presence: true
validates_uniqueness_of :token
validates :token, uniqueness: true

before_create :set_initial_token

def increment_calls_count
update_column(:calls_count, calls_count+1)
update_column(:calls_count, calls_count + 1)
end

def regenerate_token
update_attributes(token: generate_unique_secure_token)
update(token: generate_unique_secure_token)
end

private
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fab-manager",
"version": "6.3.32",
"version": "6.3.33",
"description": "Fab-manager is the FabLab management solution. It provides a comprehensive, web-based, open-source tool to simplify your administrative tasks and your marker's projects.",
"keywords": [
"fablab",
Expand Down

0 comments on commit 71c94bf

Please sign in to comment.