Skip to content

Commit

Permalink
use num_of_submissions field to prevent a recount
Browse files Browse the repository at this point in the history
  • Loading branch information
ukanga committed Apr 27, 2017
1 parent c5eb9c2 commit cdecd29
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions onadata/apps/logger/models/xform.py
Original file line number Diff line number Diff line change
Expand Up @@ -881,11 +881,7 @@ def hash(self):

@property
def can_be_replaced(self):
if hasattr(self.submission_count, '__call__'):
num_submissions = self.submission_count()
else:
num_submissions = self.submission_count
return num_submissions == 0
return self.num_of_submissions == 0

@classmethod
def public_forms(cls):
Expand Down
2 changes: 1 addition & 1 deletion onadata/apps/main/templates/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ <h3>{% blocktrans %}Shared Forms & Public Data <small>({{ num_forms }})</small>{
</td>
<td>
{% if form.shared_data %}
{% if form.submission_count %}
{% if form.num_of_submissions %}
<div class="data-download">
<span class="vertical-middle">
<i class="icon-download icon-large"></i>
Expand Down

0 comments on commit cdecd29

Please sign in to comment.