Skip to content

Commit

Permalink
[jarun#564] added redirect buttons to create modal
Browse files Browse the repository at this point in the history
  • Loading branch information
LeXofLeviafan committed Dec 5, 2022
1 parent 73786a1 commit 9d96821
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions bukuserver/templates/bukuserver/bookmark_create_modal.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
{% extends 'admin/model/modals/create.html' %}

{% block create_form %}
{{ lib.render_form(form, return_url, lib.extra(), form_opts=form_opts,
action=url_for('.create_view', url=return_url),
is_modal=True) }}
{% endblock %}

{% block tail %}
{{ super() }}
<script src="{{ url_for('static', filename='bukuserver/js/bookmark.js') }}"></script>
Expand Down
2 changes: 1 addition & 1 deletion bukuserver/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def create_model(self, form):
for key, item in (("title_in", model.title), ("desc", model.description)):
if item.strip():
kwargs[key] = item
self.model.bukudb.add_rec(**kwargs)
vars(model)['id'] = self.model.bukudb.add_rec(**kwargs)
except Exception as ex:
if not self.handle_view_exception(ex):
msg = "Failed to create record."
Expand Down

0 comments on commit 9d96821

Please sign in to comment.