omniport-backend
omniport-backend copied to clipboard
`TypeError` when no integrations are specified in `base.yml`
Describe the bug
Backend throws a TypeError if integrations is left blank in base.yml.
This is because in https://github.com/IMGIITRoorkee/omniport-backend/blob/d1261f674c2bee9561728e487db38c95b04913af/omniport/omniport/settings/configuration/integrations.py#L12
_CONF.integrations is None and hence not iterable here.
To Reproduce
Make integrations blank in base.yml
Expected behavior
There should be a check first, to see if integrations is None or not, to avoid this TypeError
Operating System:
- OS: Linux
- Browser: Firefox
Want to take up? Sure
Note that this check should be made in all the apps and services, where integrations is used. For example, in Facapp (https://github.com/IMGIITRoorkee/omniport-app-faculty-profile/blob/508c205ecc2de8dc1e9fad052e9d34d334f41ae5/views.py#L279) would throw an AttributeError here if integrations is None
In the base_stencil.yml, integration was marked as a required field with an empty dictionary by default. People mostly clone the configuration files from the documentation as it is and the files there are bit outdated. That is meant to be updated with the above-suggested change, and consecutively TypeError will be removed.