22-12-2020, 17:34
J'ai cette erreur
qu'est ce que cela veut dire ? Quelle est la solution pour y remédier ?
Mon code :
Code :
AttributeError: 'EditorTicketCreation' object has no attribute 'get_linked_editor'
Mon code :
Code :
# -*- coding: utf-8 -*-
from django.shortcuts import get_object_or_404
from django.utils.translation import gettext as _
from creme.tickets.views.ticket import TicketCreation
from ..models import Editor
#Ticket = get_ticket_model()
class EditorTicketCreation(TicketCreation):
#model = Editor
#form_class = ticket_forms.TicketCreateForm
def get_initial(self):
initial = super().get_initial()
initial['title'] = _('Need for proofreading')
editor = get_object_or_404(Editor, id=self.kwargs['editor_id'])
self.request.user.has_perm_to_view_or_die(editor) # On utilise le nom du ticket juste après
initial['description'] = _('{} is not reviewed.').format(self.get_linked_editor())
return initial