Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added exception for when the maintainer group is not created #3

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

bpraak
Copy link

@bpraak bpraak commented Oct 3, 2020

Error 404 is raised instead of 500

@@ -7,6 +7,8 @@
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.

@@ -25,3 +27,5 @@ def get_object(self, *args, **kwargs):
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.

@@ -25,3 +27,5 @@ def get_object(self, *args, **kwargs):
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