Skip to content

Commit

Permalink
euth/contrib: overwrite module django admin to redirect to project
Browse files Browse the repository at this point in the history
  • Loading branch information
sabinammm authored and fuzzylogic2000 committed Mar 22, 2022
1 parent 651a0c1 commit f2eb7b3
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions euth/contrib/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from django.contrib import admin
from django.urls import reverse

from adhocracy4.modules import models
from adhocracy4.modules.admin import ModuleAdmin as A4ModuleAdmin


class ModuleAdmin(A4ModuleAdmin):

def view_on_site(self, obj):
return reverse('project-detail', args=[str(obj.project.slug)])


admin.site.unregister(models.Module)
admin.site.register(models.Module, ModuleAdmin)

0 comments on commit f2eb7b3

Please sign in to comment.