-
Notifications
You must be signed in to change notification settings - Fork 238
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
Canonical sites for photos and galleries https://github.com/jdriscoll/django-photologue/issues/135 #136
base: master
Are you sure you want to change the base?
Conversation
…e reverse and no migrations yet
…d we automatically add it? maybe still need a datamigration to set canonical site from being null as well?
… it makes sense to migrate for multi site users
Hi Pa-jama,
I can write those additions, but it will be a week or so before I find the time to do so. If you want to make these additions yourself in the meantime, please go ahead! As for get_canonical_url(), I guess that catering for https is an edge case, and someone who needs that can easily extend Gallery and Photo to provide that functionality. |
Thanks! Same here, a bit tied up for the next 2 days, but I'll work on those things if you haven't got to it already. Also I'm currently working on a news sitemap for galleries, so I could add that as well |
Hey so I started on this, but realised I didn't understand factory-boy well enough to write the tests. The other two fixes are trivial, so is it OK if I leave it to you? and disregard what I said about google news sitemaps, mine isnt 100% compliant so if it is, I will put it into another pull request. |
I added help text (with il8n) and marked the other messages for il8n. So I wrote 3 test cases, but I can't figure out how to change the default site for client.get(). Any idea?
|
I am very busy at the moment - hence why I have not reviewed your pull request yet! Please accept my apologies, and I will get back to you soon. |
Cool, no worries. Its all done except for the tests, I'm not sure if its possible to change the domain to example.org in tests? If not, it makes it kind of impossible to write proper tests |
Just looked at your unit tests - the line
|
For users without multisite, they will not notice any differnence. There is a migration + datamigration to set canonical site for all their existing galleries and photos. It also will automatically set canonical site in the post_save just how it is currently.
For users with multisite, they will see a new field canonical site. I was not sure whether a data migration is needed for them, as it would have to choose a random site essentially. Thoughts?
I was thinking about adding validation, like if canonical site is not in sites, then automatically add it. But I just settled with a warning message in admin save. If the canonical site is not in sites, it will give a 404.
All tests are passing.
in get_canonical_url, I'm not sure whether it needs something more to set the scheme if https.