##// END OF EJS Templates
Merged in bodqhrohro/neboard-1/bodqhrohro/pillow-now-requires-zlib-too-1522164393285 (pull request #27)...
Merged in bodqhrohro/neboard-1/bodqhrohro/pillow-now-requires-zlib-too-1522164393285 (pull request #27) Pillow now requires zlib too Approved-by: Bohdan Horbyeshko <bodqhrohro@yandex.ru>

File last commit:

r1227:af86e9af merge decentral
r2097:5ab4630b merge default
Show More
generate_keypair.py
21 lines | 552 B | text/x-python | PythonLexer
__author__ = 'neko259'
from django.core.management import BaseCommand
from django.db import transaction
from boards.models import KeyPair, Post
class Command(BaseCommand):
help = 'Generates the new keypair. The first one will be primary.'
@transaction.atomic
def handle(self, *args, **options):
first_key = not KeyPair.objects.has_primary()
key = KeyPair.objects.generate_key(
primary=first_key)
print(key)
for post in Post.objects.filter(global_id=None):
post.set_global_id()