Monday, July 9, 2012

Adjustments, Improvements, and seed_db Antics

Hey all, so this week has been rather low key as I've been awaiting feedback and suggestions from everyone, but I've gotten my branch to a point where it should theoretically be ready to be merged into the main code.

So far I've done mostly cleanup work, such as adding comments to the Connection model and fixing style issues in some of my other work. Some substantial modifications I've made include cleaning up the AccessChecker class in soc.views.helper, which got pretty cluttered between my hacked-together initial demo which basically just involved me switching out Request object stuff with the Connection object. I marked a bunch of methods in that class for future removal when my code gets merged into the main branch, stuff like _canAccessRequestEntity really won't need to be there anymore since the invite and request modules will be removed an as many methods related to them as possible without breaking anything. I also removed methods that I had written but were no longer using, which cleaned up a bunch of the accumulated clutter. The status messages needed some work so I changed how the status message presented to the user is determined when viewing a connection and it seems to be working, but I'll continue to improve upon it. While doing that I realized that there was a logical bug that allowed users promoted to org admins to view and modify their own connections, which I prevented by adding a line in the canViewConnection() method in ShowConnection's checkAccess method.

Also at Daniel's suggestion I moved the HTML template that the module was using into its proper location within the gsoc template subdirectory rather than the soc request one where it was previously located. I've begun working on the tests for the connection module but only have a skeleton for the moment and am going to dedicate time to working on that module very soon.

I emailed the list about this, but nothing I do seems to enable seed_db on my appengine instance. I've made soc.logic.system.isDebug() method return True and after that even took the if statement out of soc.views.legacy so that the seed_db url pattern will always get added in, yet when I deploy it nothing seems to work. Lennard's given me some great advice on setting this up but as to why this still isn't working I'm clueless. My next step might be to try just running the seed method on the GAE interactive console to populate some data, but I'm working to get this resolved so that you all can mess around with a running instance of my code.

For when I do manage to get this to work, here are some instructions as to how to test everything out:

  1. Create a mentor profile
  2. Log in with either the default admin profile or your new mentor profile
  3. If you're an org admin, go to My Dashboard -> My Organizations -> select an org -> Start Connection -> input either the email address or link_id of your mentor profile -> Submit. If you're a mentor, get to the "View all participating organizations" page -> select an org -> Start Connection -> Submit. 
  4. The connection should be available in Dashboard -> My Connections, though there is a bug I'm working out that has to do with the org_admin_for variable in the dashboard module in gsoc; it may be something to do with the data populated by seed_db. You can avoid this bug by doing everything through Organization 0
That's it. Let me know if anything isn't working and I'll fix it, I'm on a straight sprint right now trying to get seed_db to work/populate the datastore asap. 

No comments:

Post a Comment