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

Unpersisted occurrences don't work #554

Open
h3x4git opened this issue Mar 26, 2023 · 7 comments
Open

Unpersisted occurrences don't work #554

h3x4git opened this issue Mar 26, 2023 · 7 comments

Comments

@h3x4git
Copy link

h3x4git commented Mar 26, 2023

#301
This is still an issue. Unpersisted occurrences, whether their event has a frequency rule declared or not, they still give you this error. I haven't been able to see this working yet. Persisted occurrences work fine.

Schermata del 2023-03-26 16-19-50

I'm using version 0.10.1 on test, development and production environment. Versions of Django tested: 4.1.7 (test), 3.2.16 (dev and production)

Maybe there is some bug?

The class-based view that fails is OccurrencePreview , I also tried to add a DetailView mixin. I couldn't get it to create an "object" attribute, not even by using super().get_object()

@h3x4git
Copy link
Author

h3x4git commented Mar 28, 2023

May I kindly ask anyone if this feature works for them and under which versions of this package and Django?

I'm running out of ideas

@fatboystring
Copy link

@h3x4git I've just opened a pull request that should fix this issue here:

#555

Would appreciate it if you would be able to check out that branch to see if it fixes your issue. Many thanks

@h3x4git
Copy link
Author

h3x4git commented Jul 11, 2023

Hello, I tried your fix and I don't get the AttributeError anymore. I get a Not Found error now, but I'm customizing django-scheduler URLs in this project so I don't think this is related to your fix. I tried your code both in production and in the development environment: no AttributeError at all, I think you solved the problem! Thank you for your work and for the heads-up

@h3x4git
Copy link
Author

h3x4git commented Jul 11, 2023

I checked and it seems I get the IndexError exception of line 183 inside get_object of OccurrencePreview. The URL path calling the view is the same as the original, it just comes after one further string for a more meaningful URL structure (I added "calendar/"). The path in this example is /calendario/occurrence/2/2023/7/11/2/2/15/

@llazzaro
Copy link
Owner

The branch is ready to merge. @fatboystring, what do you think about @h3x4git comments?

@h3x4git
Copy link
Author

h3x4git commented Jul 13, 2023

The issue is with another PR I had already applied #488. That URL path I mentioned seems to work fine on a test project, where the only difference with the one giving errors is I didn't use neither django-polymorph onto the Event table nor the Abstract model base setting. I started anew with the abstract version to make sure there was no contamination between environments. With the original Event model it works.

@h3x4git
Copy link
Author

h3x4git commented Jul 30, 2023

Any news, anyone? I looked into it but I don't see how the event = get_object_or_404(Event, pk=self.kwargs["event_id"]) inside the OccurrencePreview class view would not be compatible with and Abstract model base.. what will the course of action be? Will you only merge one of the two PRs?

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

3 participants