1
0
mirror of https://gitlab.com/brutaldon/brutaldon.git synced 2024-12-04 14:46:24 -05:00

Add client field to Account

This commit is contained in:
Jason McBrayer 2018-04-24 12:55:44 -04:00
parent 358602edde
commit 5c48180a7c
2 changed files with 26 additions and 1 deletions

View File

@ -0,0 +1,24 @@
# Generated by Django 2.0.4 on 2018-04-24 16:55
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('brutaldon', '0002_account'),
]
operations = [
migrations.AddField(
model_name='account',
name='client',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='brutaldon.Client'),
),
migrations.AlterField(
model_name='client',
name='api_base_id',
field=models.URLField(default='https://mastodon.social'),
),
]

View File

@ -3,7 +3,7 @@ from django.conf import settings
class Client(models.Model):
name = models.TextField(default = "brutaldon")
api_base_id = models.URLField(default="mastodon.social")
api_base_id = models.URLField(default="https://mastodon.social")
client_id = models.TextField(null=True, blank=True)
client_secret = models.TextField(null=True, blank=True)
@ -14,3 +14,4 @@ class Account(models.Model):
username = models.CharField(max_length=80)
django_user = models.ForeignKey(settings.AUTH_USER_MODEL, models.CASCADE, null=True)
access_token = models.TextField(null=True, blank=True)
client= models.ForeignKey(Client, models.SET_NULL, null=True)