summaryrefslogtreecommitdiffstats
path: root/src/lib/Server
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/Server')
-rwxr-xr-xsrc/lib/Server/Reports/importscript.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lib/Server/Reports/importscript.py b/src/lib/Server/Reports/importscript.py
index 3816435a9..30657fd07 100755
--- a/src/lib/Server/Reports/importscript.py
+++ b/src/lib/Server/Reports/importscript.py
@@ -24,12 +24,18 @@ from datetime import datetime
from time import strptime
from django.db import connection
import ConfigParser
+import difflib
def build_reason_kwargs(r_ent):
- if r_ent.get('current_bdiff', False):
+ if r_ent.get('current_bfile', False):
+ contents = binascii.a2b_base64(r_ent.get('current_bfile'))
+ rc_diff = '\n'.join(difflib.ndiff([], contents.split('\n')))
+ elif r_ent.get('current_bdiff', False):
rc_diff = binascii.a2b_base64(r_ent.get('current_bdiff'))
+ elif r_ent.get('current_diff', False):
+ rc_diff = r_ent.get('current_diff')
else:
- rc_diff = r_ent.get('current_diff', '')
+ rc_diff = ''
return dict(owner=r_ent.get('owner', default=""),
current_owner=r_ent.get('current_owner', default=""),
group=r_ent.get('group', default=""),