-
Notifications
You must be signed in to change notification settings - Fork 5
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
base: master
Are you sure you want to change the base?
Conversation
views/maintainer_group.py
Outdated
@@ -7,6 +7,8 @@ | |||
MaintainerGroupSerializer, | |||
) | |||
|
|||
from django.core.exceptions import ObjectDoesNotExist |
There was a problem hiding this comment.
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.
views/maintainer_group.py
Outdated
@@ -25,3 +27,5 @@ def get_object(self, *args, **kwargs): | |||
return MaintainerGroup.objects.get(pk=1) | |||
except IndexError: | |||
raise Http404 | |||
except ObjectDoesNotExist: |
There was a problem hiding this comment.
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.
views/maintainer_group.py
Outdated
@@ -25,3 +27,5 @@ def get_object(self, *args, **kwargs): | |||
return MaintainerGroup.objects.get(pk=1) | |||
except IndexError: |
There was a problem hiding this comment.
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.
Commit message is started with present tense. - |
…nd remove Index Error exception
…nd remove Index Error exception
Will merge once IMGIITRoorkee/omniport-frontend-maintainer-site#25 is resolved. |
Error 404 is raised instead of 500