add api_secret auth and (mostly) finalize firmware endpoint
This commit is contained in:
parent
9e9e41fb3f
commit
aa2df8d3c5
6 changed files with 123 additions and 4 deletions
|
@ -76,7 +76,7 @@ def user_detail(request, user): # todo: make class based view
|
|||
|
||||
with transaction.atomic():
|
||||
if api_secret_action in ('generate', 'regenerate'):
|
||||
api_secret = get_random_string(64, string.ascii_letters+string.digits)
|
||||
api_secret = '%d-%s' % (user.pk, get_random_string(64, string.ascii_letters+string.digits))
|
||||
permissions.api_secret = api_secret
|
||||
permissions.save()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue