Skip to content
Snippets Groups Projects
Verified Commit 7c1387cf authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Use urlparse to inject anchors in absolute urls

parent 852b6e63
No related branches found
No related tags found
1 merge request!120Resolve "Support events and extra lessons in class register"
from datetime import date
from typing import Optional, Union
from urllib.parse import urlparse
from django.db import models
from django.db.models.constraints import CheckConstraint
......@@ -231,7 +232,7 @@ class PersonalNote(RegisterObjectRelatedMixin, ExtensibleModel):
def get_absolute_url(self) -> str:
"""Get the absolute url of the detail view for the related register object."""
return super().get_absolute_url() + "#personal-notes"
return urlparse(super().get_absolute_url())._replace(fragment="personal-notes").geturl()
class Meta:
verbose_name = _("Personal note")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment