Commits

Anonymous committed 8a7c9a5

Fixed issue where prompt was not reset properly

Comments (0)

Files changed (1)

 function djexit() {
     [ -z "$DJANGO_PROJECT" ] && return 1
 
-    # Restore prompt, django settings and python path
-    PS1=$_OLD_DJENV_PS1
+    # Restore prompt
+    if [ ! -z "$_OLD_DJENV_PS1" ]; then
+        PS1=$_OLD_DJENV_PS1
+        unset _OLD_DJENV_PS1
+    fi
 
+    # Restore django settings
     if [ ! -z "$_OLD_DJANGO_SETTINGS_MODULE" ]; then
         DJANGO_SETTINGS_MODULE=$_OLD_DJANGO_SETTINGS_MODULE
     else
         unset DJANGO_SETTINGS_MODULE
     fi
 
+    # Restore python path
     if [ ! -z "$_OLD_PYTHONPATH" ]; then
         PYTHONPATH=$_OLD_PYTHONPATH
     else