Skip to content

Commit

Permalink
Disable memory hog form querying for all assets
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanqui committed Aug 12, 2024
1 parent a87e9ad commit 0be93c5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion rhinventory/admin_views/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def details_view(self):

file_assign_form = FileAssignForm()
assets = [(0, "No asset")]
assets += [(a.id, str(a)) for a in self.session.query(Asset).order_by(Asset.id.asc())]
#assets += [(a.id, str(a)) for a in self.session.query(Asset).order_by(Asset.id.asc())]
file_assign_form.asset.choices = assets
file_assign_form.asset.default = model.asset_id or 0
file_assign_form.process(request.form)
Expand Down
5 changes: 3 additions & 2 deletions rhinventory/templates/admin/file/details.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,15 @@ <h2>File: {{ model.filepath }}</h2>
{% endif %}
{% if admin_view.can_edit %}
<form method="POST" action="" style="display: inline;">
{{ file_assign_form.asset(style='margin-bottom: 0px; width: 400px;') }}
{# {{ file_assign_form.asset(style='margin-bottom: 0px; width: 400px;') }}
<input type="submit" value="
{%- if not model.asset -%}
Assign
{%- else -%}
Re-assign
{%- endif -%}
" class="btn btn-primary">
" class="btn btn-primary"> #}
Sorry the form for assigning the file will be back soon.
</form>
{% endif %}
</div>
Expand Down

0 comments on commit 0be93c5

Please sign in to comment.