Skip to content

Commit 7e6caa3

Browse files
author
Dennis Schwartz
committed
Prevent duplicate Snippets.
1 parent c5504ec commit 7e6caa3

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

main/management/commands/updatecomponents.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ def update_visualizations(component, commit_hash, test=False):
9898
try:
9999
url = create_jsdelivr_link(owner, repo_name, str('/' + sniperData.snippets_dir_name + '/' + snip['name']), commit_hash)
100100
name = snip.get('name', '').split('.')[0]
101-
Snippet.objects.create(name=name, url=url, sniperData=sniperData)
102-
print('here!')
101+
Snippet.objects.update_or_create(name=name, url=url, sniperData=sniperData)
103102
except Exception as e:
104103
print('ERROR: Something went wrong creating a new Snippet')
105104
print(e)

0 commit comments

Comments
 (0)