question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Django (1.11 at least) creates migrations for termsandconditions

See original GitHub issue

The main difference I can see is the stripping of the bytestrings?

# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-27 07:12
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('termsandconditions', '0002_termsandconditions_info'),
    ]

    operations = [
        migrations.AlterField(
            model_name='termsandconditions',
            name='date_active',
            field=models.DateTimeField(blank=True, help_text='Leave Null To Never Make Active', null=True),
        ),
        migrations.AlterField(
            model_name='termsandconditions',
            name='info',
            field=models.TextField(blank=True, help_text="Provide users with some info about what's changed and why", null=True),
        ),
        migrations.AlterField(
            model_name='termsandconditions',
            name='slug',
            field=models.SlugField(default='site-terms'),
        ),
        migrations.AlterField(
            model_name='usertermsandconditions',
            name='date_accepted',
            field=models.DateTimeField(auto_now_add=True, verbose_name='Date Accepted'),
        ),
        migrations.AlterField(
            model_name='usertermsandconditions',
            name='ip_address',
            field=models.GenericIPAddressField(blank=True, null=True, verbose_name='IP Address'),
        ),
    ]

On a separate note, would you be open to a PR which excludes Users from accepting terms if they have a certain permission?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
cyfacecommented, Jun 27, 2017

I removed the auto terms creation and added the Python3 migration…new version is up on PyPi…

0reactions
cyfacecommented, Jun 28, 2017

@ciarancourtney I debated doing it both ways for 1.1.13 - I updated the code to return None instead in 1.1.14.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Migrations - Django documentation
Migrations ¶. Migrations are Django's way of propagating changes you make to your models (adding a field, deleting a model, etc.) into your...
Read more >
How to prevent Django 1.11 from creating migrations for ...
The model wraps a custom SQL view. However, when I run manage.py makemigrations , I find that Django tries to generate a migration...
Read more >
Digging Deeper Into Django Migrations - Real Python
The migrations directory is automatically created when you create a new app with the startapp management command, but it's easy to forget when...
Read more >
Django Migrations and How to Manage Conflicts
I will mostly talk about the makemigrations command, which is responsible for creating new migrations based on the changes you have made to ......
Read more >
Django Tutorial #7 - Migrations - YouTube
Hey ninjas, in this tutorial I'll show you how we can take our models and migrate them to the database.----- COURSE LINKS:+ Python...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found