Compare commits
No commits in common. "f0fa189bcdf47b5eeeeaee2ad68bb51e861bfd50" and "f9d9923acf34de92c957d6be895a484175c96bfb" have entirely different histories.
f0fa189bcd
...
f9d9923acf
4 changed files with 5 additions and 28 deletions
|
|
@ -5,13 +5,6 @@ All notable changes to WuttaFarm will be documented in this file.
|
||||||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
||||||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
## v0.11.1 (2026-03-21)
|
|
||||||
|
|
||||||
### Fix
|
|
||||||
|
|
||||||
- improve behavior when deleting mirrored record from farmOS
|
|
||||||
- use correct uuid when processing webhook to delete record
|
|
||||||
|
|
||||||
## v0.11.0 (2026-03-15)
|
## v0.11.0 (2026-03-15)
|
||||||
|
|
||||||
### Feat
|
### Feat
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ build-backend = "hatchling.build"
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "WuttaFarm"
|
name = "WuttaFarm"
|
||||||
version = "0.11.1"
|
version = "0.11.0"
|
||||||
description = "Web app to integrate with and extend farmOS"
|
description = "Web app to integrate with and extend farmOS"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
authors = [
|
authors = [
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,8 @@ class ChangeProcessor:
|
||||||
return
|
return
|
||||||
|
|
||||||
# delete corresponding record from our app
|
# delete corresponding record from our app
|
||||||
if obj := importer.get_target_object((change.farmos_uuid,)):
|
obj = importer.get_target_object((change.uuid,))
|
||||||
|
if obj:
|
||||||
importer.delete_target_object(obj)
|
importer.delete_target_object(obj)
|
||||||
|
|
||||||
# TODO: this should live elsewhere
|
# TODO: this should live elsewhere
|
||||||
|
|
|
||||||
|
|
@ -23,9 +23,6 @@
|
||||||
Base class for WuttaFarm master views
|
Base class for WuttaFarm master views
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import threading
|
|
||||||
|
|
||||||
import requests
|
|
||||||
from webhelpers2.html import tags
|
from webhelpers2.html import tags
|
||||||
|
|
||||||
from wuttaweb.views import MasterView
|
from wuttaweb.views import MasterView
|
||||||
|
|
@ -148,24 +145,10 @@ class WuttaFarmMasterView(MasterView):
|
||||||
|
|
||||||
# maybe delete from farmOS also
|
# maybe delete from farmOS also
|
||||||
if farmos_uuid:
|
if farmos_uuid:
|
||||||
client = get_farmos_client_for_user(self.request)
|
|
||||||
# nb. must use separate thread to avoid some kind of race
|
|
||||||
# condition (?) - seems as though maybe a "boomerang"
|
|
||||||
# effect is happening; this seems to help anyway
|
|
||||||
thread = threading.Thread(
|
|
||||||
target=self.delete_from_farmos, args=(client, farmos_uuid)
|
|
||||||
)
|
|
||||||
thread.start()
|
|
||||||
|
|
||||||
def delete_from_farmos(self, client, farmos_uuid):
|
|
||||||
entity_type = self.get_farmos_entity_type()
|
entity_type = self.get_farmos_entity_type()
|
||||||
bundle = self.get_farmos_bundle()
|
bundle = self.get_farmos_bundle()
|
||||||
try:
|
client = get_farmos_client_for_user(self.request)
|
||||||
client.resource.delete(entity_type, bundle, farmos_uuid)
|
client.resource.delete(entity_type, bundle, farmos_uuid)
|
||||||
except requests.HTTPError as exc:
|
|
||||||
# ignore if record not found in farmOS
|
|
||||||
if exc.response.status_code != 404:
|
|
||||||
raise
|
|
||||||
|
|
||||||
|
|
||||||
class TaxonomyMasterView(WuttaFarmMasterView):
|
class TaxonomyMasterView(WuttaFarmMasterView):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue