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

NoActiveTermsOfService after resetting the DB #86

Open
GFuhr opened this issue Jul 23, 2024 · 3 comments
Open

NoActiveTermsOfService after resetting the DB #86

GFuhr opened this issue Jul 23, 2024 · 3 comments

Comments

@GFuhr
Copy link

GFuhr commented Jul 23, 2024

Hi,
I'm new to django and django-tos but I had the following issue :
First I started a new project, create my superuser, add my app etc and then add django-tos and it was working well, in particular I was able to log to the admin page.
Then I deleted the sqlite file (so full reset of the DB, superuser included) and create again my superuser.
However this time, since the migration for django-tos happened at the same time that I created to project I'm not even able to log for the 1st time to the admin page since there is no ToS configured and I have the exception :
NoActiveTermsOfService at /terms-of-service/confirm/
['Please create an active Terms-of-Service']

Regards,
Guillaume

@nicholasserra
Copy link
Collaborator

Could just add a data migration to the migrations to create a TOS. Also, a patch was just added via #80 to only throw the error when DEBUG is False. That change will go out on the next version bump and should also solve the issue.

cc @frankwiles we're due for a version bump on this one, thanks!

@GFuhr
Copy link
Author

GFuhr commented Jul 24, 2024

I agree for the data migration it's what I did at the end through the "django shell" to create a new ToS but based on the comments in the code, is it normal that the ToS agreement is asked when I try to log on the admin page as superuser?

@nicholasserra
Copy link
Collaborator

It's a middleware so it doesn't care what url is being hit, it'll check

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

2 participants