Commit ba215be29b64bb1619ca65d7233b97ddab3bee3e

Authored by janek37
1 parent 307739c5

drobna poprawka do renderowania tabelek

dictionary/models.py
... ... @@ -772,7 +772,10 @@ class LexemeInflectionPattern(Model):
772 772  
773 773 def inflection_table(self, variant, separated=False, qualifiers=None,
774 774 edit_view=False, attr_vals=None):
775   - tt = self.table_template(variant)
  775 + try:
  776 + tt = self.table_template(variant)
  777 + except TableTemplate.DoesNotExist:
  778 + return []
776 779 lip_qualifiers = self.qualifiers.all() if not edit_view else []
777 780 if attr_vals is None:
778 781 attr_vals = self.lexeme.lexemeattributevalue_set.all()
... ...
media/js/edit.js
... ... @@ -123,12 +123,11 @@ $(function() {
123 123 $(document).on(
124 124 'submit', '#' + edit.form_id, edit.form_submit);
125 125 $(document).on('click', '#' + edit.form_cancel_id, function () {
126   - var id = $('input[name=id]', this.form).value();
127 126 $.ajaxJSON({
128 127 method: 'get',
129 128 dest: $('#edit'),
130 129 url: $dj.ajax_edit_form,
131   - data: {id: id},
  130 + data: {id: edit.get_id()},
132 131 callback: edit.form_init
133 132 });
134 133 });
... ... @@ -144,12 +143,11 @@ $(function() {
144 143 'change', '#' + edit.form_id + ' input[type=checkbox]',
145 144 edit.show_changed);
146 145 $(document).on('click', '#' + edit.form_cancel_id, function () {
147   - var id = $('input[name=id]', this.form).value();
148 146 $.ajaxJSON({
149 147 method: 'get',
150 148 dest: $('#edit'),
151 149 url: $dj.ajax_edit_form,
152   - data: {id: id},
  150 + data: {id: edit.get_id()},
153 151 callback: edit.form_init
154 152 });
155 153 });
... ...