removing key model
diff --git a/planetstack/core/admin.py b/planetstack/core/admin.py
index 1dbe0d7..2f44f40 100644
--- a/planetstack/core/admin.py
+++ b/planetstack/core/admin.py
@@ -282,20 +282,6 @@
obj.os_manager = OpenStackManager(auth=auth, caller=request.user)
obj.delete()
-class KeyAdmin(OSModelAdmin):
- fieldsets = [
- ('Key', {'fields': ['key', 'type', 'blacklisted']})
- ]
- list_display = ['key', 'type', 'blacklisted']
-
- #def queryset(self, request):
- # admins can see all keys. Users can only see their own key.
- #if request.user.is_admin:
- # qs = super(KeyAdmin, self).queryset(request)
- #else:
- # qs = Key.objects.filter(user=request.user)
- #return qs
-
class SliceAdmin(OSModelAdmin):
fields = ['name', 'site', 'serviceClass', 'description', 'slice_url']
list_display = ('name', 'site','serviceClass', 'slice_url')
@@ -720,7 +706,6 @@
admin.site.register(Site, SiteAdmin)
admin.site.register(Slice, SliceAdmin)
#admin.site.register(Subnet)
-admin.site.register(Key, KeyAdmin)
if showAll:
diff --git a/planetstack/core/models/__init__.py b/planetstack/core/models/__init__.py
index 90bb089..4f8bd85 100644
--- a/planetstack/core/models/__init__.py
+++ b/planetstack/core/models/__init__.py
@@ -3,7 +3,6 @@
from .site import Site
from .site import SitePrivilege
from .image import Image
-from .key import Key
from .user import User
from .role import Role
from .node import Node
diff --git a/planetstack/core/models/key.py b/planetstack/core/models/key.py
deleted file mode 100644
index 6fd7c34..0000000
--- a/planetstack/core/models/key.py
+++ /dev/null
@@ -1,29 +0,0 @@
-import os
-from django.db import models
-from core.models import PlCoreBase
-
-# Create your models here.
-
-class Key(PlCoreBase):
- name = models.CharField(max_length=256)
- nkey_id = models.CharField(null=True, blank=True, max_length=256, unique=True)
- key = models.CharField(max_length=512)
- type = models.CharField(max_length=256)
- blacklisted = models.BooleanField(default=False)
-
- def __unicode__(self): return u'%s' % (self.key)
-
- def save(self, *args, **kwds):
- if not hasattr(self, 'os_manager'):
- from openstack.manager import OpenStackManager
- setattr(self, 'os_manager', OpenStackManager())
- self.os_manager.save_key(self)
- super(Key, self).save(*args, **kwds)
-
- def delete(self, *args, **kwds):
- if not hasattr(self, 'os_manager'):
- from openstack.manager import OpenStackManager
- setattr(self, 'os_manager', OpenStackManager())
- self.os_manager.delete_key(self)
- super(Key, self).delete(*args, **kwds)
-
diff --git a/planetstack/core/models/user.py b/planetstack/core/models/user.py
index d494ede..78631a7 100644
--- a/planetstack/core/models/user.py
+++ b/planetstack/core/models/user.py
@@ -4,7 +4,6 @@
from django.db import models
from core.models import PlCoreBase
from core.models import Site
-from core.models import Key
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager
from timezones.fields import TimeZoneField
@@ -63,7 +62,6 @@
phone = models.CharField(null=True, blank=True, help_text="phone number contact", max_length=100)
user_url = models.URLField(null=True, blank=True)
site = models.ForeignKey(Site, related_name='users', verbose_name="Site this user will be homed too", null=True)
- #key = models.ForeignKey(Key, related_name='user', null=True, blank=True)
public_key = models.CharField(null=True, blank=True, max_length=1024, help_text="Public key string")
is_active = models.BooleanField(default=True)
diff --git a/planetstack/core/serializers.py b/planetstack/core/serializers.py
index fd0c6c6..78bc553 100644
--- a/planetstack/core/serializers.py
+++ b/planetstack/core/serializers.py
@@ -37,19 +37,6 @@
'slice_memberships',
'site_privileges')
-class KeySerializer(serializers.HyperlinkedModelSerializer):
- id = serializers.Field()
- user = serializers.HyperlinkedRelatedField(view_name='user-detail')
- class Meta:
- model = Key
- fields = ('id',
- 'name',
- 'key',
- 'type',
- 'blacklisted',
- 'user')
-
-
class SliceSerializer(serializers.HyperlinkedModelSerializer):
# HyperlinkedModelSerializer doesn't include the id by default
id = serializers.Field()