Skip to content

Conversation

@bpraak
Copy link

@bpraak bpraak commented Oct 3, 2020

Error 404 is raised instead of 500

MaintainerGroupSerializer,
)

from django.core.exceptions import ObjectDoesNotExist
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a top-level import. Shift this to line number 2.

return MaintainerGroup.objects.get(pk=1)
except IndexError:
raise Http404
except ObjectDoesNotExist:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use MainatainerGroup.DoesNotExists. And remember to delete the import statement.


try:
return MaintainerGroup.objects.get(pk=1)
except IndexError:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know why I added this but now I think it might be unnecessary.

@algomaster99
Copy link
Member

Commit message is started with present tense. - Add exception for when the maintainer group is not created

@algomaster99
Copy link
Member

Will merge once IMGIITRoorkee/omniport-frontend-maintainer-site#25 is resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants