Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Commit

Permalink
MCKIN-28813 Add model for whitelisting sso urls via django admin (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
moeez96 authored Dec 24, 2020
1 parent 1bb9b2b commit a8e6250
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
5 changes: 5 additions & 0 deletions edx_solutions_organizations/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.contrib import admin

from .models import WhitelistedUrls

admin.site.register(WhitelistedUrls)
22 changes: 22 additions & 0 deletions edx_solutions_organizations/migrations/0008_whitelistedurls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-12-24 06:12
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('edx_solutions_organizations', '0007_auto_20200908_1553'),
]

operations = [
migrations.CreateModel(
name='WhitelistedUrls',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('url', models.URLField(max_length=255)),
],
),
]
13 changes: 13 additions & 0 deletions edx_solutions_organizations/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,16 @@ def get_value(cls, user, attribute_key, default=None):
return attribute.value
except cls.DoesNotExist:
return default


class WhitelistedUrls(models.Model):
"""
This model enlists the whitelisted urls allowed for SSO registration inside a frame
"""
url = models.URLField(max_length=255)

def __str__(self):
return self.url

class Meta:
verbose_name_plural = "Whitelisted Urls"

0 comments on commit a8e6250

Please sign in to comment.