diff --git a/DJAGEN/branches/mustafa_branch/djagen/collector/admin.py b/DJAGEN/branches/mustafa_branch/djagen/collector/admin.py index d2125b6..a7c133d 100755 --- a/DJAGEN/branches/mustafa_branch/djagen/collector/admin.py +++ b/DJAGEN/branches/mustafa_branch/djagen/collector/admin.py @@ -14,7 +14,7 @@ from djagen.collector.configini import * class AuthorsAdmin (admin.ModelAdmin): - list_display = ('author_id', 'author_name', 'author_email', 'author_face', 'current_status', 'is_approved', 'label_personal', 'label_lkd', 'label_community', 'label_eng') + list_display = ('author_id', 'author_name','author_surname' ,'author_email', 'author_face', 'current_status', 'is_approved', 'label_personal', 'label_lkd', 'label_community', 'label_eng') list_select_related = True search_fields = ['author_name', 'author_surname', 'author_email'] diff --git a/DJAGEN/branches/mustafa_branch/djagen/collector/configini.py b/DJAGEN/branches/mustafa_branch/djagen/collector/configini.py index af77005..e427ba7 100755 --- a/DJAGEN/branches/mustafa_branch/djagen/collector/configini.py +++ b/DJAGEN/branches/mustafa_branch/djagen/collector/configini.py @@ -13,7 +13,7 @@ class Handler: self.id = id self.tmp_entries_ini = os.path.join(settings.MAIN_PATH, 'tmp_ini', 'tmp_entries.ini') - + self.config_header_ini = os.path.join(settings.MAIN_PATH, 'gezegen', 'config_header.ini') self.config_entries_ini = os.path.join(settings.MAIN_PATH, 'gezegen', 'config_entries.ini') @@ -21,6 +21,8 @@ class Handler: def __set_values(self): author = Authors.objects.get(author_id = self.id) + print author + print author.author_id if not author.is_approved: return False @@ -29,7 +31,7 @@ class Handler: self.surname = author.author_surname self.face = author.author_face self.url = author.channel_url - + labels = { author.label_personal:'Personal', author.label_lkd: 'LKD', @@ -43,7 +45,7 @@ class Handler: return True def create_tmp_entries(self): - + if not self.__set_values(): return config_entries = open(self.config_entries_ini) @@ -56,6 +58,7 @@ class Handler: header = config_header.read() config_header.close() tmp_entries.write(header) + found = False for section in sections: if (section == 'Planet'): continue @@ -71,6 +74,7 @@ class Handler: config_face = None if config_id == self.id: + found = True url = self.url face = self.face @@ -98,5 +102,22 @@ class Handler: tmp_entries.write(s) + if found != True: + url = self.url + face = self.face + name = self.name + surname = self.surname + label = self.author_labels + + id = self.id + s = '['+url+']' + '\n' + s += 'name = ' + name + '\n' + s += 'surname = ' + surname + '\n' + s += 'label = ' + label + '\n' + if face: + s += 'face = ' + face + '\n' + s += 'id = ' + str(id) + '\n' + '\n' + tmp_entries.write(s) + tmp_entries.close()