Skip to content

Commit

Permalink
Merge pull request #5257 from specify/issue-5215
Browse files Browse the repository at this point in the history
Update Schema Config to include new geo fields and COG picklists
  • Loading branch information
sharadsw authored Oct 23, 2024
2 parents dfe5887 + d8800df commit d437dcb
Show file tree
Hide file tree
Showing 10 changed files with 261 additions and 83 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ LOG_LEVEL=WARNING
# should only be used during development and troubleshooting and not
# during general use. Django applications leak memory when operated
# continuously in debug mode.
SP7_DEBUG=true
SP7_DEBUG=true
5 changes: 3 additions & 2 deletions specifyweb/businessrules/rules/cogtype_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
from specifyweb.businessrules.orm_signal_handler import orm_signal_handler
from specifyweb.specify.models import Picklist, Picklistitem

SYSTEM_COGTYPES_PICKLIST = "SystemCOGTypes"

@orm_signal_handler('pre_save', 'Collectionobjectgrouptype')
def cogtype_pre_save(cog_type):

# Ensure the cog_type type is validated by being the picklist.
# NOTE: Maybe add constraint on the cog_type name in the future.
default_cog_types_picklist = Picklist.objects.get(
name="Default Collection Object Group Types",
tablename="collectionobjectgrouptype",
name=SYSTEM_COGTYPES_PICKLIST,
collection=cog_type.collection
)
if Picklistitem.objects.filter(picklist=default_cog_types_picklist, value=cog_type.type).count() == 0:
Expand Down
Loading

0 comments on commit d437dcb

Please sign in to comment.