This repository was archived by the owner on Jun 1, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed
editorsnotes/admin_custom Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -40,9 +40,10 @@ def save_zotero_data(self):
40
40
elif self .changed_data is not None and 'zotero_string' in self .changed_data :
41
41
document .zotero_data = self .cleaned_data ['zotero_string' ]
42
42
document .save ()
43
- link , created = ZoteroLink .objects .get_or_create (zotero_item = document )
44
- if not created :
45
- link .save ()
43
+ if not document .zotero_link :
44
+ ZoteroLink .objects .create (zotero_item = document )
45
+ else :
46
+ document .zotero_link .save ()
46
47
return document
47
48
48
49
class DocumentLinkForm (ModelForm ):
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ class DocumentAdminView(BaseAdminView):
14
14
model = Document
15
15
form_class = forms .DocumentForm
16
16
formset_classes = (
17
- # forms.TopicAssignmentFormset,
17
+ forms .TopicAssignmentFormset ,
18
18
forms .DocumentLinkFormset ,
19
19
forms .ScanFormset
20
20
)
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ class NoteAdminView(BaseAdminView):
18
18
model = Note
19
19
form_class = forms .NoteForm
20
20
formset_classes = (
21
- # forms.TopicAssignmentFormset,
21
+ forms . common .TopicAssignmentFormset ,
22
22
)
23
23
template_name = 'note_admin.html'
24
24
def get_object (self , note_id = None ):
You can’t perform that action at this time.
0 commit comments