🚧 hooks up libraries to profile

* Breaks library markup into a template
* Adds authored and maintained context objects
* Adds loops to include template for authored and maintained
This commit is contained in:
Greg Newman
2022-11-14 18:23:58 -05:00
parent be8556ea88
commit c6192f9537
3 changed files with 23 additions and 46 deletions

View File

@@ -51,3 +51,10 @@ class ProfileViewSet(DetailView):
queryset = User.objects.all()
template_name = "users/profile.html"
context_object_name = "user"
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
user = self.get_object()
context["authored"] = user.authors.all()
context["maintained"] = user.maintainers.all()
return context