77 # Give priority to a template. 78 if self.use_template: 79 return self.prepare_template(obj) 80 elif self.model_attr is not None: 81 # Check for `__` in the field for looking through the relation. 82 attrs = self.model_attr.split('__') 83 current_object = obj 84 85 for attr in attrs: 86 if hasattr(current_object, attr): 87 raise SearchFieldError("The model '%s' does not have a model_attr '%s'." % (repr(current_object), attr)) 88 89 current_object = getattr(current_object, attr, None) 90 91 if current_object is None: 92 if self.has_default(): 93 current_object = self._default 94 # Fall out of the loop, given any further attempts at 95 # accesses will fail misreably.
Thanks Rob On Tuesday, 17 October 2017 06:28:49 UTC+1, Christian Hammond wrote: > > Can you show me all the code within about 5 lines of your modification? > > Christian > > > On Mon, Oct 16, 2017 at 18:01 'Rob Backhurst' via reviewboard < > revie...@googlegroups.com <javascript:>> wrote: > >> Hi Christian, >> >> It crashes straight away with this error... >> >> Removing all documents from your index because you said so. >> All documents removed. >> Indexing 558 users >> ERROR:root:Error updating auth using default >> Traceback (most recent call last): >> File >> "/usr/lib/python2.7/site-packages/haystack/management/commands/update_index.py", >> >> line 188, in handle_label >> self.update_backend(label, using) >> File >> "/usr/lib/python2.7/site-packages/haystack/management/commands/update_index.py", >> >> line 233, in update_backend >> do_update(backend, index, qs, start, end, total, >> verbosity=self.verbosity, commit=self.commit) >> File >> "/usr/lib/python2.7/site-packages/haystack/management/commands/update_index.py", >> >> line 96, in do_update >> backend.update(index, current_qs, commit=commit) >> File >> "/usr/lib/python2.7/site-packages/haystack/backends/whoosh_backend.py", >> line 196, in update >> doc = index.full_prepare(obj) >> File "/usr/lib/python2.7/site-packages/haystack/indexes.py", line 212, >> in full_prepare >> self.prepared_data = self.prepare(obj) >> File "/usr/lib/python2.7/site-packages/haystack/indexes.py", line 203, >> in prepare >> self.prepared_data[field.index_fieldname] = field.prepare(obj) >> File "/usr/lib/python2.7/site-packages/haystack/fields.py", line 159, >> in prepare >> return self.convert(super(CharField, self).prepare(obj)) >> File "/usr/lib/python2.7/site-packages/haystack/fields.py", line 87, in >> prepare >> raise SearchFieldError("The model '%s' does not have a model_attr >> '%s'." % (repr(current_object), attr)) >> SearchFieldError: The model '<User: admin>' does not have a model_attr >> 'username'. >> - show quoted text - >> File "/usr/lib/python2.7/site-packages/haystack/fields.py", line 159, >> in prepare >> return self.convert(super(CharField, self).prepare(obj)) >> File "/usr/lib/python2.7/site-packages/haystack/fields.py", line 87, in >> prepare >> raise SearchFieldError("The model '%s' does not have a model_attr >> '%s'." % (repr(current_object), attr)) >> haystack.exceptions.SearchFieldError: The model '<User: admin>' does not >> have a model_attr 'username'. >> >> Thanks >> Rob >> >> On Monday, 16 October 2017 22:46:09 UTC+1, Christian Hammond wrote: >> >>> Hi Rob, >>> >>> Actually, this should function as a workaround for now. You can do this >>> in that same Haystack file. Change the entirety of that previous code to: >>> >>> hasattr(current_object, attr) >>> >>> if hasattr(current_object, attr): >>> raise SearchFieldError("The model '%s' does not have a >>> model_attr '%s'." % (repr(current_object), attr)) >>> >>> What will happen is the initial hasattr will trigger the crash that's >>> resulting in the failure, but we're discarding the result of the initial >>> one. A lucky (in this case) side-effect is that only the first call on a >>> given review request will fail, and the second will succeed (internal state >>> caching stuff). This should allow a full index to proceed. >>> >>> It's a temporary fix until we get the next release out. >>> >>> Christian >>> >> On Mon, Oct 16, 2017 at 11:48 AM, 'Rob Backhurst' via reviewboard < >>> revie...@googlegroups.com> wrote: >>> >> Thanks Christian, is that something we’ll need to do directly to the >>>> database? I don’t suppose you have any info on what needs to be done? Our >>>> DBA is on leave at the mo. >>>> >>>> No probs, not always easy to get to the bottom of these things! >>>> >>>> Thanks >>>> >>> Rob >>>> >>>> Sent from my iPhone >>>> >>>> On 16 Oct 2017, at 19:15, Christian Hammond <chri...@beanbaginc.com> >>>> wrote: >>>> >>>> Interesting. Okay, yeah, you'd need to remove the commit ID from one of >>>> them for now. I'll put a fix together for the next 2.5.x and schedule a >>>> release. Thanks for your patience on this! >>>> >>>> Christian >>>> >>>> >>>> On Mon, Oct 16, 2017 at 07:46 'Rob Backhurst' via reviewboard < >>>> revie...@googlegroups.com> wrote: >>>> >>>> Hi Christian, >>>>> >>>>> Here you go... >>>>> >>>>> ERROR:root:Error updating reviews using default >>>>> Traceback (most recent call last): >>>>> File >>>>> "/usr/lib/python2.7/site-packages/haystack/management/commands/update_index.py", >>>>> >>>>> line 188, in handle_label >>>>> self.update_backend(label, using) >>>>> File >>>>> "/usr/lib/python2.7/site-packages/haystack/management/commands/update_index.py", >>>>> >>>>> line 233, in update_backend >>>>> do_update(backend, index, qs, start, end, total, >>>>> verbosity=self.verbosity, commit=self.commit) >>>>> File >>>>> "/usr/lib/python2.7/site-packages/haystack/management/commands/update_index.py", >>>>> >>>>> line 96, in do_update >>>>> backend.update(index, current_qs, commit=commit) >>>>> File >>>>> "/usr/lib/python2.7/site-packages/haystack/backends/whoosh_backend.py", >>>>> line 196, in update >>>>> doc = index.full_prepare(obj) >>>>> File "/usr/lib/python2.7/site-packages/haystack/indexes.py", line >>>>> 212, in full_prepare >>>>> self.prepared_data = self.prepare(obj) >>>>> File "/usr/lib/python2.7/site-packages/haystack/indexes.py", line >>>>> 203, in prepare >>>>> self.prepared_data[field.index_fieldname] = field.prepare(obj) >>>>> File "/usr/lib/python2.7/site-packages/haystack/fields.py", line >>>>> 166, in prepare >>>>> return self.convert(super(CharField, self).prepare(obj)) >>>>> File "/usr/lib/python2.7/site-packages/haystack/fields.py", line 90, >>>>> in prepare >>>>> getattr(current_object, attr) >>>>> File >>>>> "/usr/lib/python2.7/site-packages/reviewboard/reviews/models/review_request.py", >>>>> >>>>> line 273, in get_commit >>>>> commit_id=six.text_type(self.changenum)) >>>>> File "/usr/lib/python2.7/site-packages/django/db/models/query.py", >>>>> line 493, in update >>>>> rows = query.get_compiler(self.db).execute_sql(None) >>>>> File >>>>> "/usr/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line >>>>> 980, in execute_sql >>>>> cursor = super(SQLUpdateCompiler, self).execute_sql(result_type) >>>>> File >>>>> "/usr/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line >>>>> 786, in execute_sql >>>>> cursor.execute(sql, params) >>>>> File "/usr/lib/python2.7/site-packages/django/db/backends/util.py", >>>>> line 53, in execute >>>>> return self.cursor.execute(sql, params) >>>>> File "/usr/lib/python2.7/site-packages/django/db/utils.py", line 99, >>>>> in __exit__ >>>>> six.reraise(dj_exc_type, dj_exc_value, traceback) >>>>> File "/usr/lib/python2.7/site-packages/django/db/backends/util.py", >>>>> line 53, in execute >>>>> return self.cursor.execute(sql, params) >>>>> File >>>>> "/usr/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line >>>>> 124, in execute >>>>> return self.cursor.execute(query, args) >>>>> File "/usr/lib64/python2.7/site-packages/MySQLdb/cursors.py", line >>>>> 205, in execute >>>>> self.errorhandler(self, exc, value) >>>>> File "/usr/lib64/python2.7/site-packages/MySQLdb/connections.py", >>>>> line 36, in defaulterrorhandler >>>>> raise errorclass, errorvalue >>>>> IntegrityError: (1062, "Duplicate entry '1701871-1' for key >>>>> 'reviews_reviewrequest_b8c24015'") >>>>> Traceback (most recent call last): >>>>> File "/usr/bin/rb-site", line 9, in <module> >>>>> load_entry_point('ReviewBoard==2.5.16', 'console_scripts', >>>>> 'rb-site')() >>>>> File >>>>> "/usr/lib/python2.7/site-packages/reviewboard/cmdline/rbsite.py", line >>>>> 1964, in main >>>>> command.run() >>>>> File >>>>> "/usr/lib/python2.7/site-packages/reviewboard/cmdline/rbsite.py", line >>>>> 1884, in run >>>>> site.run_manage_command(args[0], args[1:]) >>>>> File >>>>> "/usr/lib/python2.7/site-packages/reviewboard/cmdline/rbsite.py", line >>>>> 712, >>>>> in run_manage_command >>>>> execute_from_command_line([__file__, cmd] + params) >>>>> File >>>>> "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", >>>>> line >>>>> 399, in execute_from_command_line >>>>> utility.execute() >>>>> File >>>>> "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", >>>>> line >>>>> 392, in execute >>>>> self.fetch_command(subcommand).run_from_argv(self.argv) >>>>> File >>>>> "/usr/lib/python2.7/site-packages/django/core/management/base.py", line >>>>> 242, in run_from_argv >>>>> self.execute(*args, **options.__dict__) >>>>> File >>>>> "/usr/lib/python2.7/site-packages/django/core/management/base.py", line >>>>> 285, in execute >>>>> output = self.handle(*args, **options) >>>>> File >>>>> "/usr/lib/python2.7/site-packages/reviewboard/reviews/management/commands/index.py", >>>>> >>>>> line 19, in handle >>>>> call_command('rebuild_index', interactive=False) >>>>> File >>>>> "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", >>>>> line >>>>> 159, in call_command >>>>> return klass.execute(*args, **defaults) >>>>> File >>>>> "/usr/lib/python2.7/site-packages/django/core/management/base.py", line >>>>> 285, in execute >>>>> output = self.handle(*args, **options) >>>>> File >>>>> "/usr/lib/python2.7/site-packages/haystack/management/commands/rebuild_index.py", >>>>> >>>>> line 26, in handle >>>>> call_command('update_index', **options) >>>>> File >>>>> "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", >>>>> line >>>>> 159, in call_command >>>>> return klass.execute(*args, **defaults) >>>>> File >>>>> "/usr/lib/python2.7/site-packages/django/core/management/base.py", line >>>>> 285, in execute >>>>> output = self.handle(*args, **options) >>>>> File >>>>> "/usr/lib/python2.7/site-packages/haystack/management/commands/update_index.py", >>>>> >>>>> line 183, in handle >>>>> return super(Command, self).handle(*items, **options) >>>>> File >>>>> "/usr/lib/python2.7/site-packages/django/core/management/base.py", line >>>>> 385, in handle >>>>> label_output = self.handle_label(label, **options) >>>>> File >>>>> "/usr/lib/python2.7/site-packages/haystack/management/commands/update_index.py", >>>>> >>>>> line 188, in handle_label >>>>> self.update_backend(label, using) >>>>> File >>>>> "/usr/lib/python2.7/site-packages/haystack/management/commands/update_index.py", >>>>> >>>>> line 233, in update_backend >>>>> do_update(backend, index, qs, start, end, total, >>>>> verbosity=self.verbosity, commit=self.commit) >>>>> File >>>>> "/usr/lib/python2.7/site-packages/haystack/management/commands/update_index.py", >>>>> >>>>> line 96, in do_update >>>>> backend.update(index, current_qs, commit=commit) >>>>> File >>>>> "/usr/lib/python2.7/site-packages/haystack/backends/whoosh_backend.py", >>>>> line 196, in update >>>>> doc = index.full_prepare(obj) >>>>> File "/usr/lib/python2.7/site-packages/haystack/indexes.py", line >>>>> 212, in full_prepare >>>>> self.prepared_data = self.prepare(obj) >>>>> File "/usr/lib/python2.7/site-packages/haystack/indexes.py", line >>>>> 203, in prepare >>>>> self.prepared_data[field.index_fieldname] = field.prepare(obj) >>>>> File "/usr/lib/python2.7/site-packages/haystack/fields.py", line >>>>> 166, in prepare >>>>> return self.convert(super(CharField, self).prepare(obj)) >>>>> File "/usr/lib/python2.7/site-packages/haystack/fields.py", line 90, >>>>> in prepare >>>>> getattr(current_object, attr) >>>>> File >>>>> "/usr/lib/python2.7/site-packages/reviewboard/reviews/models/review_request.py", >>>>> >>>>> line 273, in get_commit >>>>> commit_id=six.text_type(self.changenum)) >>>>> File "/usr/lib/python2.7/site-packages/django/db/models/query.py", >>>>> line 493, in update >>>>> rows = query.get_compiler(self.db).execute_sql(None) >>>>> File >>>>> "/usr/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line >>>>> 980, in execute_sql >>>>> cursor = super(SQLUpdateCompiler, self).execute_sql(result_type) >>>>> File >>>>> "/usr/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line >>>>> 786, in execute_sql >>>>> cursor.execute(sql, params) >>>>> File "/usr/lib/python2.7/site-packages/django/db/backends/util.py", >>>>> line 53, in execute >>>>> return self.cursor.execute(sql, params) >>>>> File "/usr/lib/python2.7/site-packages/django/db/utils.py", line 99, >>>>> in __exit__ >>>>> six.reraise(dj_exc_type, dj_exc_value, traceback) >>>>> File "/usr/lib/python2.7/site-packages/django/db/backends/util.py", >>>>> line 53, in execute >>>>> return self.cursor.execute(sql, params) >>>>> File >>>>> "/usr/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line >>>>> 124, in execute >>>>> return self.cursor.execute(query, args) >>>>> File "/usr/lib64/python2.7/site-packages/MySQLdb/cursors.py", line >>>>> 205, in execute >>>>> self.errorhandler(self, exc, value) >>>>> File "/usr/lib64/python2.7/site-packages/MySQLdb/connections.py", >>>>> line 36, in defaulterrorhandler >>>>> raise errorclass, errorvalue >>>>> django.db.utils.IntegrityError: (1062, "Duplicate entry '1701871-1' >>>>> for key 'reviews_reviewrequest_b8c24015'") >>>>> >>>>> >>>>> The error looks familiar - we had some issue sin the past with >>>>> duplicate entries. >>>>> The index never used to fail for them though... >>>>> >>>>> Thanks >>>>> Rob >>>>> >>>>> >>>>> >>>>> On Monday, 16 October 2017 10:38:52 UTC+1, Christian Hammond wrote: >>>>> >>>>>> Hi Rob, >>>>>> >>>>>> I think what's happening is that there's an exception being raised >>>>>> the first time this is accessed that is resulting in hasattr failing. >>>>>> One >>>>>> more check (I'm about to go to bed so I'll have to follow up in the >>>>>> morning). >>>>>> >>>>>> Before the "has_attr = ..." line, add: >>>>>> >>>>>> if attr == 'commit': >>>>>> getattr(current_object, attr) >>>>>> >>>>>> I imagine that's going to result in a new crash, which is good. Show >>>>>> me what that says. >>>>>> >>>>>> Christian >>>>>> >>>>> On Mon, Oct 16, 2017 at 2:09 AM, 'Rob Backhurst' via reviewboard < >>>>>> revie...@googlegroups.com> wrote: >>>>>> >>>>> Hi Chris, >>>>>>> >>>>>>> Certainly seems a bit weird - I appreciate all your efforts so far!. >>>>>>> See the out put from the latest index below. If this doesn't tell >>>>>>> you anything useful, perhaps we can try (on our test system) removing >>>>>>> the >>>>>>> review/record that seems to be causing this and re-run the index? >>>>>>> >>>>>>> >>>>>>> ERROR:root:Error updating reviews using default >>>>>>> Traceback (most recent call last): >>>>>>> File >>>>>>> "/usr/lib/python2.7/site-packages/haystack/management/commands/update_index.py", >>>>>>> >>>>>>> line 188, in handle_label >>>>>>> self.update_backend(label, using) >>>>>>> File >>>>>>> "/usr/lib/python2.7/site-packages/haystack/management/commands/update_index.py", >>>>>>> >>>>>>> line 233, in update_backend >>>>>>> do_update(backend, index, qs, start, end, total, >>>>>>> verbosity=self.verbosity, commit=self.commit) >>>>>>> File >>>>>>> "/usr/lib/python2.7/site-packages/haystack/management/commands/update_index.py", >>>>>>> >>>>>>> line 96, in do_update >>>>>>> backend.update(index, current_qs, commit=commit) >>>>>>> File >>>>>>> "/usr/lib/python2.7/site-packages/haystack/backends/whoosh_backend.py", >>>>>>> line 196, in update >>>>>>> doc = index.full_prepare(obj) >>>>>>> File "/usr/lib/python2.7/site-packages/haystack/indexes.py", line >>>>>>> 212, in full_prepare >>>>>>> self.prepared_data = self.prepare(obj) >>>>>>> File "/usr/lib/python2.7/site-packages/haystack/indexes.py", line >>>>>>> 203, in prepare >>>>>>> self.prepared_data[field.index_fieldname] = field.prepare(obj) >>>>>>> File "/usr/lib/python2.7/site-packages/haystack/fields.py", line >>>>>>> 164, in prepare >>>>>>> return self.convert(super(CharField, self).prepare(obj)) >>>>>>> File "/usr/lib/python2.7/site-packages/haystack/fields.py", line >>>>>>> 92, in prepare >>>>>>> raise SearchFieldError("The model '%s' ('%s' -- %s.%s at %s -- >>>>>>> %s:%s) does not have a model_attr '%s' (%s -- %s)." % >>>>>>> (obj.__class__.__name__, current_object.pk, >>>>>>> current_object.__class__.__module__, current_object.__class__.__name__, >>>>>>> inspect.getfile(obj.__class__), id(obj), id(current_object), attr, >>>>>>> hasattr(current_object, attr), has_attr)) >>>>>>> SearchFieldError: The model 'ReviewRequest' ('27393' -- >>>>>>> reviewboard.reviews.models.review_request.ReviewRequest at >>>>>>> /usr/lib/python2.7/site-packages/reviewboard/reviews/models/review_request.pyc >>>>>>> >>>>>>> -- 231638480:231638480) does not have a model_attr 'commit' (True -- >>>>>>> False). >>>>>>> Traceback (most recent call last): >>>>>>> File "/usr/bin/rb-site", line 9, in <module> >>>>>>> load_entry_point('ReviewBoard==2.5.16', 'console_scripts', >>>>>>> 'rb-site')() >>>>>>> File >>>>>>> "/usr/lib/python2.7/site-packages/reviewboard/cmdline/rbsite.py", line >>>>>>> 1964, in main >>>>>>> command.run() >>>>>>> File >>>>>>> "/usr/lib/python2.7/site-packages/reviewboard/cmdline/rbsite.py", line >>>>>>> 1884, in run >>>>>>> site.run_manage_command(args[0], args[1:]) >>>>>>> File >>>>>>> "/usr/lib/python2.7/site-packages/reviewboard/cmdline/rbsite.py", line >>>>>>> 712, >>>>>>> in run_manage_command >>>>>>> execute_from_command_line([__file__, cmd] + params) >>>>>>> File >>>>>>> "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", >>>>>>> line >>>>>>> 399, in execute_from_command_line >>>>>>> utility.execute() >>>>>>> File >>>>>>> "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", >>>>>>> line >>>>>>> 392, in execute >>>>>>> self.fetch_command(subcommand).run_from_argv(self.argv) >>>>>>> File >>>>>>> "/usr/lib/python2.7/site-packages/django/core/management/base.py", line >>>>>>> 242, in run_from_argv >>>>>>> self.execute(*args, **options.__dict__) >>>>>>> File >>>>>>> "/usr/lib/python2.7/site-packages/django/core/management/base.py", line >>>>>>> 285, in execute >>>>>>> output = self.handle(*args, **options) >>>>>>> File >>>>>>> "/usr/lib/python2.7/site-packages/reviewboard/reviews/management/commands/index.py", >>>>>>> >>>>>>> line 19, in handle >>>>>>> call_command('rebuild_index', interactive=False) >>>>>>> File >>>>>>> "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", >>>>>>> line >>>>>>> 159, in call_command >>>>>>> return klass.execute(*args, **defaults) >>>>>>> File >>>>>>> "/usr/lib/python2.7/site-packages/django/core/management/base.py", line >>>>>>> 285, in execute >>>>>>> output = self.handle(*args, **options) >>>>>>> File >>>>>>> "/usr/lib/python2.7/site-packages/haystack/management/commands/rebuild_index.py", >>>>>>> >>>>>>> line 26, in handle >>>>>>> call_command('update_index', **options) >>>>>>> File >>>>>>> "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", >>>>>>> line >>>>>>> 159, in call_command >>>>>>> return klass.execute(*args, **defaults) >>>>>>> File >>>>>>> "/usr/lib/python2.7/site-packages/django/core/management/base.py", line >>>>>>> 285, in execute >>>>>>> output = self.handle(*args, **options) >>>>>>> File >>>>>>> "/usr/lib/python2.7/site-packages/haystack/management/commands/update_index.py", >>>>>>> >>>>>>> line 183, in handle >>>>>>> return super(Command, self).handle(*items, **options) >>>>>>> File >>>>>>> "/usr/lib/python2.7/site-packages/django/core/management/base.py", line >>>>>>> 385, in handle >>>>>>> label_output = self.handle_label(label, **options) >>>>>>> File >>>>>>> "/usr/lib/python2.7/site-packages/haystack/management/commands/update_index.py", >>>>>>> >>>>>>> line 188, in handle_label >>>>>>> self.update_backend(label, using) >>>>>>> File >>>>>>> "/usr/lib/python2.7/site-packages/haystack/management/commands/update_index.py", >>>>>>> >>>>>>> line 233, in update_backend >>>>>>> do_update(backend, index, qs, start, end, total, >>>>>>> verbosity=self.verbosity, commit=self.commit) >>>>>>> File >>>>>>> "/usr/lib/python2.7/site-packages/haystack/management/commands/update_index.py", >>>>>>> >>>>>>> line 96, in do_update >>>>>>> backend.update(index, current_qs, commit=commit) >>>>>>> File >>>>>>> "/usr/lib/python2.7/site-packages/haystack/backends/whoosh_backend.py", >>>>>>> line 196, in update >>>>>>> doc = index.full_prepare(obj) >>>>>>> File "/usr/lib/python2.7/site-packages/haystack/indexes.py", line >>>>>>> 212, in full_prepare >>>>>>> self.prepared_data = self.prepare(obj) >>>>>>> File "/usr/lib/python2.7/site-packages/haystack/indexes.py", line >>>>>>> 203, in prepare >>>>>>> self.prepared_data[field.index_fieldname] = field.prepare(obj) >>>>>>> File "/usr/lib/python2.7/site-packages/haystack/fields.py", line >>>>>>> 164, in prepare >>>>>>> return self.convert(super(CharField, self).prepare(obj)) >>>>>>> File "/usr/lib/python2.7/site-packages/haystack/fields.py", line >>>>>>> 92, in prepare >>>>>>> raise SearchFieldError("The model '%s' ('%s' -- %s.%s at %s -- >>>>>>> %s:%s) does not have a model_attr '%s' (%s -- %s)." % >>>>>>> (obj.__class__.__name__, current_object.pk, >>>>>>> current_object.__class__.__module__, current_object.__class__.__name__, >>>>>>> inspect.getfile(obj.__class__), id(obj), id(current_object), attr, >>>>>>> hasattr(current_object, attr), has_attr)) >>>>>>> haystack.exceptions.SearchFieldError: The model 'ReviewRequest' >>>>>>> ('27393' -- reviewboard.reviews.models.review_request.ReviewRequest at >>>>>>> /usr/lib/python2.7/site-packages/reviewboard/reviews/models/review_request.pyc >>>>>>> >>>>>>> -- 231638480:231638480) does not have a model_attr 'commit' (True -- >>>>>>> False). >>>>>>> >>>>>>> >>>>>>> Thaks >>>>>>> Rob >>>>>>> >>>>>>> >>>>>>> >>>>>>> On Monday, 16 October 2017 06:31:25 UTC+1, Christian Hammond wrote: >>>>>>>> >>>>>>>> Hi Rob, >>>>>>>> >>>>>>>> At this point, "Gremlins" appear to be the best answer from what >>>>>>>> I'm able to see right now. The output in that error is directly >>>>>>>> contradicting the conditional that allows the error to be shown, so >>>>>>>> something really bizarre is happening that absolutely should not be >>>>>>>> able to >>>>>>>> happen. It's not normal. >>>>>>>> >>>>>>>> There's one last thing I want to see... I don't think it's going to >>>>>>>> give me any answers directly, but let's see where this goes. >>>>>>>> >>>>>>>> Change the code to: >>>>>>>> >>>>>>>> import inspect >>>>>>>> has_attr = hasattr(current_object, attr) >>>>>>>> print '%r (%s): %s' % (current_object.__class__, >>>>>>>> id(current_object), has_attr) >>>>>>>> if not has_attr: >>>>>>>> raise SearchFieldError("The model '%s' ('%s' -- %s.%s at %s >>>>>>>> -- %s:%s) does not have a model_attr '%s' (%s -- %s)." % >>>>>>>> (obj.__class__.__name__, current_object.pk, >>>>>>>> current_object.__class__.__module__, current_object.__class >>>>>>>> >>>>>>> -- Supercharge your Review Board with Power Pack: https://www.reviewboard.org/powerpack/ Want us to host Review Board for you? Check out RBCommons: https://rbcommons.com/ Happy user? Let us know! https://www.reviewboard.org/users/ --- You received this message because you are subscribed to the Google Groups "reviewboard" group. To unsubscribe from this group and stop receiving emails from it, send an email to reviewboard+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.