Skip to content

Commit

Permalink
Merge branch 'production' into issue-5461
Browse files Browse the repository at this point in the history
  • Loading branch information
acwhite211 committed Dec 20, 2024
2 parents f01ca5e + 9e21603 commit 2254274
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 2 deletions.
46 changes: 46 additions & 0 deletions .github/DISCUSSION_TEMPLATE/feature_requests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
title: "[Feature Request] "
labels: ["Feature Request"]
body:
- type: markdown
attributes:
value: |
Thank you for your interest in improving this project! Please fill out the following sections to help us understand your feature request better.
- type: textarea
id: problem-description
attributes:
label: Is your feature request related to a problem? Please describe.
description: "A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]"
value: |
...
render: bash
validations:
required: true
- type: textarea
id: solution-description
attributes:
label: Describe the solution you'd like
description: "A clear and concise description of what you want to happen."
value: |
...
render: bash
validations:
required: true
- type: textarea
id: alternatives-considered
attributes:
label: Describe alternatives you've considered
description: "A clear and concise description of any alternative solutions or features you've considered."
value: |
...
render: bash
- type: input
id: reported-by
attributes:
label: Reported By
description: "Name of institution"
validations:
required: true
- type: markdown
attributes:
value: |
Thank you for your feedback! We appreciate your suggestions and will review them as soon as possible.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Feature request
about: Suggest an idea for this project
title: ''
labels: 1 - Request
labels: 1 - Enhancement
assignees: ''

---
Expand Down
6 changes: 5 additions & 1 deletion specifyweb/specify/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -809,8 +809,8 @@ def update_obj(collection, agent, name: str, id, version, data: Dict[str, Any],
else:
obj.modifiedbyagent = agent

bump_version(obj, version)
_handle_special_update_priors(obj, data)
bump_version(obj, version)
obj.save(force_update=True)
auditlog.update(obj, agent, parent_obj, dirty)
for dep in dependents_to_delete:
Expand Down Expand Up @@ -843,6 +843,8 @@ def bump_version(obj, version) -> None:
manager = obj.__class__._base_manager
updated = manager.filter(pk=obj.pk, version=version).update(version=version+1)
if not updated:
if obj._meta.model_name in {'collectionobjectgroupjoin'}:
return # TODO: temporary solution to allow for multiple updates to the same cojo object
raise StaleObjectException("%s object %d is out of date" % (obj.__class__.__name__, obj.id))
obj.version = version + 1

Expand Down Expand Up @@ -1078,6 +1080,8 @@ def _save_cojo_prior(obj):
"""
if obj._meta.model_name in {'collectionobject', 'collectionobjectgroup'} and hasattr(obj, 'cojo'):
obj.cojo.save()
elif obj._meta.model_name in {'collectionobjectgroupjoin'}:
obj.save()

def _handle_special_save_priors(obj):
"""
Expand Down

0 comments on commit 2254274

Please sign in to comment.