Closed
Bug 1504324
Opened 7 years ago
Closed 7 years ago
[traceback] "TypeError: issubclass() arg 1 must be a class" in API machinery
Categories
(Socorro :: Webapp, task, P3)
Socorro
Webapp
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: willkg, Assigned: willkg)
Details
Attachments
(1 file)
https://sentry.prod.mozaws.net/operations/socorro-new-prod/issues/4906705/
"""
TypeError: issubclass() arg 1 must be a class
File "django/core/handlers/exception.py", line 41, in inner
response = get_response(request)
File "django/core/handlers/base.py", line 187, in _get_response
response = self.process_exception_by_middleware(e, request)
File "django/core/handlers/base.py", line 185, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "django/views/decorators/csrf.py", line 58, in wrapped_view
return view_func(*args, **kwargs)
File "ratelimit/decorators.py", line 30, in _wrapped
return fn(*args, **kw)
File "crashstats/crashstats/decorators.py", line 109, in inner
response = view(request, *args, **kwargs)
File "crashstats/crashstats/utils.py", line 443, in wrapper
response = f(request, *args, **kw)
File "crashstats/crashstats/utils.py", line 56, in wrapper
response = f(request, *args, **kw)
File "crashstats/api/views.py", line 180, in model_wrapper
if model is None or not is_valid_model_class(model):
File "crashstats/api/views.py", line 147, in is_valid_model_class
issubclass(model, models.SocorroMiddleware) and
"""
"model" here is the supersearch Python module because they went to /api/supersearch/ (lowercase) instead of /api/Supersearch/ .
I think we should fix "is_valid_model_class" to check a pre-generated list of models and not do a bunch of potentially fail-heavy computery.
This covers that work.
| Assignee | ||
Comment 1•7 years ago
|
||
Making this a P3. It's good to do, but it's not a big deal.
Priority: -- → P3
| Assignee | ||
Comment 2•7 years ago
|
||
Assignee: nobody → willkg
Comment 3•7 years ago
|
||
Commits pushed to master at https://github.com/mozilla-services/socorro
https://github.com/mozilla-services/socorro/commit/330f7962373edcce2fd84f4ac2dd53a5eda07d48
fix bug 1504324: handle when model is not a class
https://github.com/mozilla-services/socorro/commit/01e25a0cb41886dde3bc73e3d64657eaf9fe87f0
Merge pull request #4782 from willkg/1504324-models
fix bug 1504324: handle when model is not a class
Updated•7 years ago
|
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•