Skip to content
Snippets Groups Projects
Commit 4040322d authored by Carlos Vega's avatar Carlos Vega
Browse files

added method to check if code is running in the context of migrate or makemigrations

parent 8088d783
No related branches found
No related tags found
1 merge request!192Feature/add way to change password and PERMISSIONS
...@@ -4,7 +4,10 @@ import datetime ...@@ -4,7 +4,10 @@ import datetime
from datetime import timedelta from datetime import timedelta
from web.algorithm import VerhoeffAlgorithm, LuhnAlgorithm from web.algorithm import VerhoeffAlgorithm, LuhnAlgorithm
import sys
def is_django_migrating():
return ('makemigrations' in sys.argv or 'migrate' in sys.argv)
def is_valid_social_security_number(number): def is_valid_social_security_number(number):
if number is not None and number != '': if number is not None and number != '':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment