omniport-backend icon indicating copy to clipboard operation
omniport-backend copied to clipboard

`TypeError` when no integrations are specified in `base.yml`

Open nisarg73 opened this issue 5 years ago • 2 comments

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

nisarg73 avatar Aug 02 '20 23:08 nisarg73

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

nisarg73 avatar Aug 02 '20 23:08 nisarg73

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.

pradumangoyal avatar Aug 03 '20 04:08 pradumangoyal