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

Fix map alias url #844

Merged
merged 2 commits into from
May 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion g3w-admin/client/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,13 @@ def get_context_data(self, **kwargs):
contextData = super(ClientView, self).get_context_data(**kwargs)

# group serializer
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,
Comment on lines +85 to +91
Copy link
Contributor

@Raruto Raruto May 10, 2024

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

Copy link
Member Author

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?

Copy link
Contributor

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)

projectId=str(self.project.pk),
projectType=kwargs['project_type'],
request=self.request
Expand Down