Skip to content

Commit

Permalink
migration for hiding secret key from admin
Browse files Browse the repository at this point in the history
  • Loading branch information
jdungan committed Aug 22, 2016
1 parent 7e90eaa commit a582f5b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
10 changes: 2 additions & 8 deletions payments/admin.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import json

from django.contrib import admin
from .models import StripeAccount, StripeEvent

Expand All @@ -18,12 +16,8 @@ class StripeEventAdmin(admin.ModelAdmin):
search_fields = ['message_text']

readonly_fields = (
'type', 'created', 'event_id', 'processed', 'message_text',)

def message_text(self, instance):
# Convert the data to sorted, indented JSON
response = json.dumps(instance.message_text, sort_keys=True, indent=2)
return response
'user_id', 'type', 'created', 'event_id', 'verified',
'processed', 'message_text',)

admin.site.register(StripeAccount, StripeAccountAdmin)
admin.site.register(StripeEvent, StripeEventAdmin)
20 changes: 20 additions & 0 deletions payments/migrations/0005_auto_20160822_1210.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-08-22 12:10
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('payments', '0004_stripeevent_verified'),
]

operations = [
migrations.AlterField(
model_name='stripeaccount',
name='secret_key',
field=models.CharField(blank=True, editable=False, max_length=100),
),
]

0 comments on commit a582f5b

Please sign in to comment.