Skip to content

Instantly share code, notes, and snippets.

@avalanchy
Last active July 20, 2018 12:45
Show Gist options
  • Save avalanchy/0efd50c632f37b0074cf9438e7b497ca to your computer and use it in GitHub Desktop.
Save avalanchy/0efd50c632f37b0074cf9438e7b497ca to your computer and use it in GitHub Desktop.
Overridden Django 2 command that always creates a migration with the name "m", by which we can catch conflicts at the level of the Pull Request
from django.core.management.commands import makemigrations
class Command(makemigrations.Command):
def handle(self, *args, **options):
self.stdout.write(self.style.HTTP_NOT_FOUND(
'This is the overridden command that always creates a migration '
'with the name "m", by which we can catch conflicts at the level '
'of the Pull Request.'
))
options['name'] = 'm'
super().handle(*args, **options)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment