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

Remove hard coded dependency on stats from the files app #249

Merged
merged 2 commits into from
Oct 9, 2024

Conversation

kimakan
Copy link
Contributor

@kimakan kimakan commented Oct 8, 2024

Closes #248

@kimakan kimakan requested a review from roerch October 8, 2024 09:01
@kimakan kimakan linked an issue Oct 8, 2024 that may be closed by this pull request
@coveralls
Copy link

coveralls commented Oct 8, 2024

Pull Request Test Coverage Report for Build 11233210493

Details

  • 1 of 4 (25.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.02%) to 63.968%

Changes Missing Coverage Covered Lines Changed/Added Lines %
daiquiri/files/utils.py 1 4 25.0%
Totals Coverage Status
Change from base Build 10420115417: -0.02%
Covered Lines: 4820
Relevant Lines: 7535

💛 - Coveralls

Copy link

@roerch roerch left a comment

Choose a reason for hiding this comment

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

Looks fine to me. Thanks for implementing this.

@jochenklar
Copy link
Member

Hi @kimakan , while this should work, the django way to do this would be:

from django.apps import apps

if apps.is_installed('daiquiri.stats'):
    from daiquiri.stats.models import Record
    ...

we had a similar problem here: https://github.com/django-daiquiri/daiquiri/blob/master/daiquiri/oai/adapter.py#L365

Also, I would add that to all Record.objects.create().

@kimakan
Copy link
Contributor Author

kimakan commented Oct 8, 2024

Hi @jochenklar , thanks for the suggestion! I thought about adding this to every Record.objects.create() but in the end, it would not solve the dependency in the migrations, so I didn't do it.

@kimakan kimakan merged commit e2aaadc into master Oct 9, 2024
10 checks passed
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

Successfully merging this pull request may close these issues.

IMPROVEMENT: dependencies of daiquiri apps
4 participants