force absolute path in addterms command
authorSofia Papagiannaki <papagian@gmail.com>
Mon, 26 Mar 2012 10:24:07 +0000 (13:24 +0300)
committerSofia Papagiannaki <papagian@gmail.com>
Mon, 26 Mar 2012 10:24:07 +0000 (13:24 +0300)
Refs: #2019

snf-astakos-app/astakos/im/management/commands/addterms.py

index 783d956..8eadfb0 100644 (file)
@@ -36,6 +36,7 @@ from random import choice
 from string import digits, lowercase, uppercase
 from uuid import uuid4
 from time import time
 from string import digits, lowercase, uppercase
 from uuid import uuid4
 from time import time
+from os.path import abspath
 
 from django.core.management.base import BaseCommand, CommandError
 
 
 from django.core.management.base import BaseCommand, CommandError
 
@@ -49,7 +50,7 @@ class Command(BaseCommand):
         if len(args) != 1:
             raise CommandError("Invalid number of arguments")
         
         if len(args) != 1:
             raise CommandError("Invalid number of arguments")
         
-        location = args[0].decode('utf8')
+        location = abspath(args[0].decode('utf8'))
         try:
             f = open(location, 'r')
         except IOError:
         try:
             f = open(location, 'r')
         except IOError: