L
L
leha782016-02-18 08:46:14
Django
leha78, 2016-02-18 08:46:14

Where to change django_admin_log model?

AUTH_USER_MODEL = 'accounts.User'
I am using accounts.User instead of auth.User . But when I try to add any entry from the admin panel, I get an error (1452, 'Cannot add or update a child row: a foreign key constraint fails (`stroymaster`.`django_admin_log`, CONSTRAINT `django_admin_log_user_id_3e2f281f_fk_auth_user_id` FOREIGN KEY (`user_id` ) REFERENCES `auth_user` (`id`))')
Where to change auth.User to accounts.User in django_admin_log model?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
leha78, 2016-02-18
@leha78

Found, in django.contrib there is a
class LogEntry(models.Model):
action_time = models.DateTimeField(_('action time'), auto_now=True)
user = models.ForeignKey('accounts.User')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question