django-admin-views icon indicating copy to clipboard operation
django-admin-views copied to clipboard

Duplicated admin views links in admin

Open PleiadiBot opened this issue 7 years ago • 1 comments

Trying the example in the REDME, I'm experiencing some problem.

I get duplicated links in the admin dashboard for the admin_views. screen shot 2017-07-21 at 11 02 57

this is my admin class

class TestAdmin(AdminViews):
    admin_views = (
        ('Redirect to CNN', 'redirect_to_cnn'),
        ('Go to revsys.com', 'http://www.revsys.com'),
    )

    def redirect_to_cnn(self, *args, **kwargs):
        return redirect('http://www.cnn.com')


admin.site.register(TestModel, TestAdmin)

This admin is a part of a big project with a lot of customization so it's probably a bad scenario to use as a test but I noticed that everything works good by resetting the output_urls property (self.output_urls = []) at the top of the grt_urls method:


def get_urls(self):
        original_urls = super(AdminViews, self).get_urls()
        added_urls = []
        self.output_urls = []

Do you think it's ok for a PR

PleiadiBot avatar Jul 21 '17 09:07 PleiadiBot

Hi, Just took over the project. Can't reproduce. Can you try again?

koleror avatar Nov 02 '22 00:11 koleror