Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

self.all_details is None (?) #41

Open
Hypurrnating opened this issue Mar 7, 2024 · 0 comments
Open

self.all_details is None (?) #41

Hypurrnating opened this issue Mar 7, 2024 · 0 comments

Comments

@Hypurrnating
Copy link

Hypurrnating commented Mar 7, 2024

File "/app/main.py", line 184, in _ua

ua['device_type'] = parsed.device_type()

^^^^^^^^^^^^^^^^^^^^

File "/opt/venv/lib/python3.11/site-packages/device_detector/device_detector.py", line 560, in device_type

dt = self.all_details.get('device', {}).get('type', '')

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

AttributeError: 'NoneType' object has no attribute 'get'

parsed.device attribute also returns None, but it looks like here its self.all_details that is causing the error. Thats not possible either cause I called .all_details, and it is definitely not None.

parsed = DeviceDetector(request.user_agent.string).parse()
ua = parsed.all_details
ua['device'] = parsed.device
ua['device_type'] = parsed.device_type()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant