Added a data migration for htpasswd import, to be run as part of the deployment of the django-auth release.
- Legacy-Id: 7584
This commit is contained in:
parent
4c0d52d9ed
commit
303e93f65f
26
ietf/ietfauth/migrations/0001_import_htpasswd.py
Normal file
26
ietf/ietfauth/migrations/0001_import_htpasswd.py
Normal file
|
@ -0,0 +1,26 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import print_function
|
||||
from django.conf import settings
|
||||
from south.v2 import DataMigration
|
||||
from ietf.utils.management.commands.import_htpasswd import import_htpasswd_file
|
||||
|
||||
class Migration(DataMigration):
|
||||
|
||||
def forwards(self, orm):
|
||||
"Write your forwards methods here."
|
||||
# Note: Don't use "from appname.models import ModelName".
|
||||
# Use orm.ModelName to refer to models in this application,
|
||||
# and orm['appname.ModelName'] for models in other applications.
|
||||
print("Importing password hashes from %s," % settings.HTPASSWD_FILE)
|
||||
print("leaving entries without matching usernames alone.")
|
||||
import_htpasswd_file(settings.HTPASSWD_FILE, verbosity=2)
|
||||
|
||||
def backwards(self, orm):
|
||||
"Write your backwards methods here."
|
||||
|
||||
models = {
|
||||
|
||||
}
|
||||
|
||||
complete_apps = ['ietfauth']
|
||||
symmetrical = True
|
0
ietf/ietfauth/migrations/__init__.py
Normal file
0
ietf/ietfauth/migrations/__init__.py
Normal file
Loading…
Reference in a new issue