|
@@ -1,7 +1,7 @@
|
|
|
import os
|
|
|
|
|
|
from django.db import models
|
|
|
-from django.conf import settings
|
|
|
+from django.contrib.auth import get_user_model
|
|
|
|
|
|
from tickets.models.ticket import Ticket
|
|
|
|
|
@@ -12,7 +12,7 @@ def get_attachment_upload_dir(instance, filename):
|
|
|
|
|
|
class Attachment(models.Model):
|
|
|
ticket = models.ForeignKey(Ticket, on_delete=models.CASCADE)
|
|
|
- added_by = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
|
|
|
+ added_by = models.ForeignKey(get_user_model(), on_delete=models.CASCADE)
|
|
|
timestamp = models.DateTimeField(auto_now_add=True)
|
|
|
file = models.FileField(upload_to=get_attachment_upload_dir, max_length=255)
|
|
|
|