mirror of
https://github.com/pretix/pretix.git
synced 2026-05-04 15:04:03 +00:00
Account history view
This commit is contained in:
@@ -2,9 +2,11 @@ from django.conf import settings
|
||||
from django.contrib.auth.models import (
|
||||
AbstractBaseUser, BaseUserManager, PermissionsMixin,
|
||||
)
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.db import models
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django_otp.models import Device
|
||||
|
||||
from pretix.base.i18n import language
|
||||
from pretix.helpers.urls import build_absolute_uri
|
||||
|
||||
@@ -152,6 +154,13 @@ class User(AbstractBaseUser, PermissionsMixin, LoggingMixin):
|
||||
except SendMailException:
|
||||
pass # Already logged
|
||||
|
||||
@property
|
||||
def all_logentries(self):
|
||||
from pretix.base.models import LogEntry
|
||||
|
||||
return LogEntry.objects.filter(content_type=ContentType.objects.get_for_model(User),
|
||||
object_id=self.pk)
|
||||
|
||||
|
||||
class U2FDevice(Device):
|
||||
json_data = models.TextField()
|
||||
|
||||
@@ -37,8 +37,7 @@ class LogEntry(models.Model):
|
||||
def display(self):
|
||||
from ..signals import logentry_display
|
||||
|
||||
if self.event:
|
||||
for receiver, response in logentry_display.send(self.event, logentry=self):
|
||||
if response:
|
||||
return response
|
||||
for receiver, response in logentry_display.send(self.event, logentry=self):
|
||||
if response:
|
||||
return response
|
||||
return self.action_type
|
||||
|
||||
Reference in New Issue
Block a user