bihealth / sodar-core

SODAR Core: A Django-based framework for building scientific data management web apps
MIT License
9 stars 1 forks source link

Add "is set" method to AppSettingAPI #1450

Closed mikkonie closed 1 month ago

mikkonie commented 2 months ago

We've had cases where we want to check in code whether an app setting has been set or not. While this is in most cases not very relevant as "not set" and "returning default value" are the same thing from the API's perspective, it could be useful in e.g. cases where an app sets a PROJECT_USER setting and wants to make sure it doesn't do it multiple times redundantly.

This can be done by importing the AppSetting model and doing a direct query on that. But since we have this nice API anyway and want to discourage direct model access in this case, why not add a simple is_set() method to the API.

Not urgent though, so tagging this for v1.1.

mikkonie commented 2 months ago

On second though, since this is such a trivial thing to add and we already have a real-life use case for it, I'll just squeeze this into v1.0.

mikkonie commented 1 month ago

Done.