Deprecated: Constant E_STRICT is deprecated since 8.4, the error level was removed in /home/hybird/newwwwcreme/forum/inc/class_error.php on line 64
Creation module : ticket.py
Les avertissements suivants se sont produits :
Warning [2] Undefined variable $unreadreports - Line: 21 - File: global.php(961) : eval()'d code PHP 8.5.12 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/global.php(961) : eval()'d code 21 errorHandler->error_callback
/global.php 961 eval
/showthread.php 28 require_once
Warning [2] Undefined property: MyLanguage::$bottomlinks_forumteam - Line: 2 - File: global.php(1047) : eval()'d code PHP 8.5.12 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/global.php(1047) : eval()'d code 2 errorHandler->error_callback
/global.php 1047 eval
/showthread.php 28 require_once




Creation module : ticket.py
#1
J'ai cette erreur
Code :
AttributeError: 'EditorTicketCreation' object has no attribute 'get_linked_editor'
qu'est ce que cela veut dire ? Quelle est la solution pour y remédier ?

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
  Répondre


Messages dans ce sujet
Creation module : ticket.py - par Patix - 22-12-2020, 17:34
RE: Creation module : ticket.py - par genglert - 22-12-2020, 20:08
RE: Creation module : ticket.py - par Patix - 22-12-2020, 20:36
RE: Creation module : ticket.py - par genglert - 22-12-2020, 20:43

Atteindre :


Utilisateur(s) parcourant ce sujet : 1 visiteur(s)