osuosl / orvsd_central

5 stars 2 forks source link

Brownju/bug/47 #78

Closed Chetco closed 10 years ago

Chetco commented 10 years ago

Added a module for validating user input, moved the location of orvsd_central.database.Model to orvsd_central.models.Model, and added tests to general.register() which the function itself still needs to be tested for correctness.

dean commented 10 years ago

Also make sure you run pep8 against files you've touched before you make a PR.

Chetco commented 10 years ago

r?

dean commented 10 years ago

I added some more comments and tests should be written for the functions you've created.

Chetco commented 10 years ago

@dean r?

So Model was moved to models.py because init_db had a small import hack to avoid an import error. I also created a separate utility module, util_validation.py, because I was not able to import util.py without a cyclic import. This will also help the seperation of util.py in the future. The check for duplicate username is done by exception handling to avoid race conditions.

Chetco commented 10 years ago

I've tested initdb and register functions which appear to work as desired. @brutal-chaos r? dean recommends someone else besides myself test this PR as well.

justinnoah commented 10 years ago

Since this was going to became a bit of a hassle, I rebased this with current develop and opened a new PR, #94. Closing as we should move to that one.