Closed Bug 1076879 Opened 10 years ago Closed 9 years ago

[traceback] "AttributeError: type object 'ResponseMappingType' has no attribute 'split'" when editing from admin

Categories

(Input Graveyard :: Submission, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: willkg, Assigned: willkg)

Details

(Whiteboard: u=dev c=codequality p=1 s=input.2015q1)

I got a handful of these today when adding responses by hand from the admin:


Task fjord.search.tasks.index_item_task with id 10b7fc0e-6f40-4338-9b4f-f449b0906676 raised exception:
'AttributeError("type object \'ResponseMappingType\' has no attribute \'split\'",)'


Task was called with args: (<class 'fjord.feedback.models.ResponseMappingType'>, 4626219L) kwargs: {'_dummy': True}.

The contents of the full traceback was:

Traceback (most recent call last):
  File "/data/www/input.mozilla.org/input/vendor/src/celery/celery/task/trace.py", line 233, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/data/www/input.mozilla.org/input/vendor/src/celery/celery/task/trace.py", line 420, in __protected_call__
    return self.run(*args, **kwargs)
  File "/data/www/input.mozilla.org/input/fjord/search/tasks.py", line 73, in index_item_task
    mapping_type = from_class_path(cls_path)
  File "/data/www/input.mozilla.org/input/fjord/search/utils.py", line 56, in from_class_path
    module_path, cls_name = cls_path.split(':')
AttributeError: type object 'ResponseMappingType' has no attribute 'split'


I'm guessing what's going on is that there's a path through the code where updating a response creates an indexing task that's got a poorly formed cls_path.
Bumping to 2015q1 because we're out of time for 2014q4.
Whiteboard: u=dev c=codequality p= s=input.2014q4 → u=dev c=codequality p= s=input.2015q1
Changing this to a P1. It should get done asap.
Priority: P3 → P1
Adam: Can you write up the steps you used to reproduce this?
Flags: needinfo?(aokoye)
I am not positive I reproduced the error but if it did it was when I was running this code at the bottom of _handle_feedback_post within the fjord/feedback/views.py file:

    if request.session.get('has_commented', False):
            return HttpResponse("You've already commented.")
            request_id = datetime.date
        request_id.save()
        request.session['has_commented'] = True
        return HttpResponse('Thanks for your comment!') 

I think what's causing it is: request_id = datetime.date . The error would occur when I would attempt to submit feedback, specifically when the feedback was attempting to save.
Flags: needinfo?(aokoye)
Found the problem--grabbing this to fix now.
Assignee: nobody → willkg
Status: NEW → ASSIGNED
Whiteboard: u=dev c=codequality p= s=input.2015q1 → u=dev c=codequality p=1 s=input.2015q1
Pushed this to production just now. Marking as FIXED.
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Product: Input → Input Graveyard
You need to log in before you can comment on or make changes to this bug.