Skip to content

Commit 303e93f

Browse files
committed
Added a data migration for htpasswd import, to be run as part of the deployment of the django-auth release.
- Legacy-Id: 7584
1 parent 4c0d52d commit 303e93f

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# -*- coding: utf-8 -*-
2+
from __future__ import print_function
3+
from django.conf import settings
4+
from south.v2 import DataMigration
5+
from ietf.utils.management.commands.import_htpasswd import import_htpasswd_file
6+
7+
class Migration(DataMigration):
8+
9+
def forwards(self, orm):
10+
"Write your forwards methods here."
11+
# Note: Don't use "from appname.models import ModelName".
12+
# Use orm.ModelName to refer to models in this application,
13+
# and orm['appname.ModelName'] for models in other applications.
14+
print("Importing password hashes from %s," % settings.HTPASSWD_FILE)
15+
print("leaving entries without matching usernames alone.")
16+
import_htpasswd_file(settings.HTPASSWD_FILE, verbosity=2)
17+
18+
def backwards(self, orm):
19+
"Write your backwards methods here."
20+
21+
models = {
22+
23+
}
24+
25+
complete_apps = ['ietfauth']
26+
symmetrical = True

ietf/ietfauth/migrations/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)