Closed wannabeCitizen closed 8 years ago
@wannabeCitizen there's a default processor
method implemented in BaseProcessor
that just returns True
... so not making your own basically just says 'let everyone in'. If you want consistency with the rest of the processors, simply have the class:
class TOSProcessor(BaseProcessor):
name = 'tos_processor'
auth = False
and your done. Remember you only need to do that super().__init__()
thing if you want to customize the init... if you aren't doing anything you don't need it.
actually, one small thing needs to happen for that to work.... go to the basehandler and add the method:
def register_handlers(self):
return []
Aight, changed it according to your suggestions. This should be all good to review and merge.
@wannabeCitizen your merge now
With that change the tos_processor
handler doesn't get created at all. It had worked before though. Any thoughts on why it's not registering that handler?
is that what you mean?
Yes, let me test
Still not seeing a handler being created :(
Err wait, got a handler, but it doesn't return name
response:
{"data": [{"name": null, "userid": null, "rfid": "24002370", "permission": true}], "status_code": 200, "timestamp": 1461084358.258522}
Even though I'm using an rfid that has an attached user and the other processors return name.
this pull request started before the name pr was merged
I merged master onto the branch before testing but after the names PR was merged
✔ quantifieddev ~/data/gulper tos-processor > git merge master
Already up-to-date.
sorry not sure I get what that means. Isn't that PR merged into master as well?
it means your $ git merge master
is wrong since master has the code to return a name and this branch doesn't.
Sorry, but that's not the case, when I open that exact file, the lines are there:
for userid in userids:
11 perm = yield exibperm.permission_meta(userid, name)
10 result.append({"userid": userid, "rfid": None,
9 "permission": perm['permission'],
8 "name": perm['name']})
7 for rfid in rfids:
6 userid = yield rfidb.rfid_to_userid(rfid)
5 perm = yield exibperm.permission_meta(userid, name)
4 result.append({"userid": userid, "rfid": rfid,
3 "permission": perm['permission'],
2 "name": perm['name']})
Also when I just merged pr0n updates and then remerged on tos_processor, I saw all the correct updates happen. I think however you modified Basehandler for tos_processor just doesn't grab the name for some reason.
-_- fine, i just did it in this pr
Worked @mynameisfiber is a sexy beast. No denying that!
The Terms Of Service Game does not use any data and, in fact doesn't need an API. I added a processor simply so the Auth API could still return true. Feels important to keep consistency (and keep the riff-raff no-data users out)
I did it in compliance of how @mynameisfiber did
recommend_processor
with the class attributeAuth = false
.I feel like I don't even know if I need a handler at all. Will the Auth API work if I don't register a process handler? Plz review @mynameisfiber