Fixed 'adding members by web form' feature:
* It now just not only updates the existing members, but also adds new members that are approved. * add 'author_surname' field for the admin view, in admin.py
This commit is contained in:
parent
ed235f018d
commit
cb90ae2092
|
@ -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']
|
||||
|
|
|
@ -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
|
||||
|
@ -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()
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user