Skip to content

Commit

Permalink
Make user blankable
Browse files Browse the repository at this point in the history
Fixes #38
  • Loading branch information
paltman committed Jan 30, 2018
1 parent d576b3b commit 0e52a17
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
20 changes: 20 additions & 0 deletions pinax/referrals/migrations/0002_auto_20180130_0904.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 2.0.1 on 2018-01-30 09:04

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('referrals', '0001_initial'),
]

operations = [
migrations.AlterField(
model_name='referral',
name='user',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='referral_codes', to=settings.AUTH_USER_MODEL),
),
]
3 changes: 2 additions & 1 deletion pinax/referrals/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ class Referral(models.Model):
AUTH_USER_MODEL,
on_delete=models.SET_NULL,
related_name="referral_codes",
null=True
null=True,
blank=True
)
label = models.CharField(max_length=100, blank=True)
code = models.CharField(max_length=40, unique=True)
Expand Down

0 comments on commit 0e52a17

Please sign in to comment.