These are chat archives for CharlesGust/django-imagr

20th
Nov 2014
Ben Friedland
@BFriedland
Nov 20 2014 00:19
I found a critical error where a user with no albums would get a 404 because homepage was calling get_list_or_404, which we never ran into before because the testing users have always had albums associated with them.
I fixed it easily and checked all other occurrences of 404 in the entire views.py file, and they all make sense. They're used in places like getting the user's own user object (guaranteed to work if they're logged in, which all the non-frontpage views require), or trying to delete a photo or album (404 if there is no photo or album with that id).
CharlesGust/django-imagr#25 is the pull request I think will be sufficient for submitting as a completed assignment. If you want to check it again, feel free to. I ran through the basic functions but didn't do too many unusual options for adding photos and albums since there are too many permutations to devote that much time to it right now.
Charlie
@charlieRode
Nov 20 2014 00:25
Been trying to figure out fabric, boot and s3 today... Beating my head against the wall. Have you made any progress on deployment?
Ben Friedland
@BFriedland
Nov 20 2014 00:27
No, we decided to do deployments last and wrap up all the pre-deployment website finalization... It's possible that changing a small part of forms, views, html or the settings file could break something we did during deployment if we deploy before finishing those parts. Most concerned about the settings file.
Though we will be doing deployment tomorrow. I think we're almost done with the previous steps -- we have the views, forms, tests, admin, registration all filled in.
Ben Friedland
@BFriedland
Nov 20 2014 01:01
There was another tiny longstanding problem with a nasty-looking solution... We didn't have 'shared' doing anything the entire time, even though Dan told us to make it work something like Twitter's follow system (where you follow someone and get to see their photos).
I fixed it by adding an additional check to the conditonal on both album_page and photo_page, where it asks if the photo is 'public' or if the photo's user's ID is the request's user's ID... The additional check adds the ability to view the page if the photo is 'shared' and the user is following the album owner, which is a very awkward model query.
For the photo_page view that query is:
this_user.following.filter(pk=this_photo.user_id)[0].id
Ben Friedland
@BFriedland
Nov 20 2014 01:06
Compare that with the current user's own ID and if they match, you're following that photo's owner.
I tested all three published modes on two users for both album_page and photo_page and verified that you don't get redirects for photos that are shared if you're following the owner and do if you're not, can see photos that are public all the time, and can never see others' photos if they are private (but can see your own).
Ben Friedland
@BFriedland
Nov 20 2014 01:20
Adding it was actually really easy, but I was so worried it wouldn't work that I spent a while testing it, making sure everything lined up, and documenting it. But now it works, so hopefully Dan will approve of the functionality.
Ben Friedland
@BFriedland
Nov 20 2014 01:38
Whoops, I forgot to test what happens if the user is not following the person. It failed the check because you can't get the id of item zero in an empty list.
I fixed it by making the ID -1 if there was no list, which properly fails the conditional without crashing the page.
Ben Friedland
@BFriedland
Nov 20 2014 02:03
The most recent pull request is now CharlesGust/django-imagr#28
I feel like there's an endless well of tiny errors that don't break the site even though they technically stop some part of the specifications. I think I'm going to head home before I find any more, hah.
Charles Gust
@CharlesGust
Nov 20 2014 06:19
wise choice