Basic logic for signing/verifying requests

This commit is contained in:
Eliot Berriot 2018-03-24 15:20:15 +01:00
parent ae65190364
commit aa7365b71f
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
7 changed files with 98 additions and 2 deletions

View file

@ -31,7 +31,11 @@ def cache():
def factories(db):
from funkwhale_api import factories
for v in factories.registry.values():
v._meta.strategy = factory.CREATE_STRATEGY
try:
v._meta.strategy = factory.CREATE_STRATEGY
except AttributeError:
# probably not a class based factory
pass
yield factories.registry
@ -39,7 +43,11 @@ def factories(db):
def nodb_factories():
from funkwhale_api import factories
for v in factories.registry.values():
v._meta.strategy = factory.BUILD_STRATEGY
try:
v._meta.strategy = factory.BUILD_STRATEGY
except AttributeError:
# probably not a class based factory
pass
yield factories.registry