10 lines
223 B
Python
10 lines
223 B
Python
|
|
from django.contrib.auth.mixins import UserPassesTestMixin
|
|
|
|
|
|
class AdminRequiredMixin(UserPassesTestMixin):
|
|
"""Make sure user is administrator"""
|
|
|
|
def test_func(self):
|
|
return self.request.user.is_superuser
|