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

"AttributeError: 'NoneType' object has no attribute '_meta'" on object detail view when Relationships reference nonexistent data models #2077

Closed
glennmatthews opened this issue Jul 20, 2022 · 2 comments · Fixed by #2078
Assignees
Labels
type: bug Something isn't working as expected

Comments

@glennmatthews
Copy link
Contributor

glennmatthews commented Jul 20, 2022

Environment

  • Python version:
  • Nautobot version: 1.3.8

Steps to Reproduce

  1. Define a Relationship between a core model and a plugin model
  2. Define RelationshipAssociations involving this relationship
  3. Uninstall the plugin and restart Nautobot
  4. Access the detail view of an instance of the core model that has at least one such RelationshipAssociation defined

Expected Behavior

Page to load and render successfully

Observed Behavior

Page load fails, with AttributeError: 'NoneType' object has no attribute '_meta'

Deleting the Relationship(s) in question appears to restore normal operation.

May be reproducible on main.demo.nautobot.com when the database is regenerated, as its data set includes plugin-model relationships on Device, but main.demo (unlike demo.nautobot.com) doesn't actually install any plugins.

@glennmatthews glennmatthews added the type: bug Something isn't working as expected label Jul 20, 2022
@glennmatthews glennmatthews self-assigned this Jul 20, 2022
@glennmatthews
Copy link
Contributor Author

Similar to the issues fixed in #1644; need to identify how this case differs and why it wasn't caught in that fix.

@glennmatthews
Copy link
Contributor Author

image

glennmatthews added a commit that referenced this issue Jul 20, 2022
bryanculver pushed a commit that referenced this issue Jul 25, 2022
smk4664 added a commit to smk4664/nautobot that referenced this issue Jul 29, 2022
* next: (26 commits)
  Include relationships and associations on object REST APIs (nautobot#2092)
  Add release-note for nautobot#2116
  Update Releases Batched for Next (next) (nautobot#2116)
  Re-ordered migrations
  Add release-note for nautobot#1226, nautobot#1739, nautobot#2115
  Add custom job intervals (nautobot#2084)
  Implement Notes Model (nautobot#1984)
  Update Lock-file Patch Releases for Develop (nautobot#2115)
  update paginator to enforce max_page_size setting in web ui views (nautobot#2112)
  Add missing location status migration (nautobot#2100)
  update release-notes for issue nautobot#2060
  added peer_id filter for relationship associations (nautobot#2113)
  Add release-note for nautobot#2025
  Cleanup group names, manual approval for flake8 (nautobot#2025)
  updated documentations for nautobot#2109 and nautobot#2111
  fixed one to many relationship source filter and apply AND operator between filters (nautobot#2111)
  Version bump to v1.3.10-beta.1, seeded next version in docs.
  Add release-note for nautobot#860, nautobot#1694, nautobot#2081. Update release date, version.
  Fix nautobot#2077 - handle case on object detail views where a relationship involves a non-installed model (nautobot#2078)
  Fix error raised if status connected not found when creating a cable (nautobot#2089)
  ...

# Conflicts:
#	nautobot/circuits/api/serializers.py
#	nautobot/core/api/serializers.py
#	nautobot/dcim/api/serializers.py
#	nautobot/docs/development/best-practices.md
#	nautobot/docs/development/style-guide.md
#	nautobot/docs/release-notes/version-1.4.md
#	nautobot/extras/api/nested_serializers.py
#	nautobot/extras/api/relationships.py
#	nautobot/extras/api/serializers.py
#	nautobot/extras/tests/integration/test_notes.py
#	nautobot/extras/tests/test_api.py
#	nautobot/utilities/testing/api.py
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug Something isn't working as expected
Projects
No open projects
Archived in project
1 participant