-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
Fix map alias url #844
Fix map alias url #844
Conversation
try: | ||
group = self.project.group | ||
except: | ||
group = get_object_or_404(Group, slug=kwargs['group_slug']) | ||
|
||
groupSerializer = GroupSerializer( | ||
getattr(self.project, 'group', get_object_or_404(Group, slug=kwargs['group_slug'])), | ||
group, |
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.
@wlorenzetti I tried it like the following and it works the same:
# group serializer
# try:
# group = self.project.group
# except:
# group = get_object_or_404(Group, slug=kwargs['group_slug'])
groupSerializer = GroupSerializer(
self.project.group,
projectId=str(self.project.pk),
projectType=kwargs['project_type'],
request=self.request
)
Just to know, the CU plugin is a special case of projects without a group? ref: e634b10
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.
@Raruto do you mean CDU?
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.
@wlorenzetti maybe it's a mispelling, I find it through git blame: e634b10 (commited on Nov 27, 2017)
Fixes a regression introduced by: #836
Closes: #843
Motivation
Checking the getattr statement before the default value that in the case of url alias return a 404.