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

Fixes #515 - Make it work with Django 4.1 #516

Merged
merged 2 commits into from
Aug 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions actstream/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ def label(model_class):
def is_installed(model_class):
"""
Returns True if a model_class is installed.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comments should also be adjusted, i think

Copy link
Contributor Author

@marcusaram marcusaram Aug 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That part is still correct. The method will return True is the model class is installed in Django. If the app is not in the INSTALLED_APPS of Django this will return False. That is also the behavior before. But changed the line below that _meta.installed works reliable from Django 1.7+ to _meta.app_config.

model_class._meta.installed is only reliable in Django 1.7+
model_class._meta.app_config is only reliable in Django 1.7+
"""
return model_class._meta.installed
return model_class._meta.app_config is not None


def validate(model_class, exception_class=ImproperlyConfigured):
Expand Down