##// END OF EJS Templates
Added image for midi/mid file format. Store only common file formats (e.g. same image for different formats) in the code, otherwise get the image file directly from the statics
Added image for midi/mid file format. Store only common file formats (e.g. same image for different formats) in the code, otherwise get the image file directly from the statics

File last commit:

r1227:af86e9af merge decentral
r1779:96b4c2f6 default
Show More
generate_keypair.py
21 lines | 552 B | text/x-python | PythonLexer
neko259
Added GET request handler, command for key generation. Changed KeyPair format for ecdsa (use to_string instead of to_pem because it's shorter)
r836 __author__ = 'neko259'
from django.core.management import BaseCommand
from django.db import transaction
neko259
Merged with default branch
r1015 from boards.models import KeyPair, Post
neko259
Added GET request handler, command for key generation. Changed KeyPair format for ecdsa (use to_string instead of to_pem because it's shorter)
r836
class Command(BaseCommand):
help = 'Generates the new keypair. The first one will be primary.'
@transaction.atomic
def handle(self, *args, **options):
neko259
Merged with default branch
r1015 first_key = not KeyPair.objects.has_primary()
neko259
Added GET request handler, command for key generation. Changed KeyPair format for ecdsa (use to_string instead of to_pem because it's shorter)
r836 key = KeyPair.objects.generate_key(
neko259
Merged with default branch
r1015 primary=first_key)
print(key)
neko259
Merged with default branch
r1227 for post in Post.objects.filter(global_id=None):
post.set_global_id()