1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-28 09:24:24 +01:00

Merge branch 'dev' for release 6.3.33

This commit is contained in:
Du Peng 2024-10-02 18:38:56 +02:00
commit 71c94bfb90
4 changed files with 14 additions and 8 deletions

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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",