Skip to content

Commit

Permalink
Merge pull request #6 from FINRAOS/v.2019.02.21
Browse files Browse the repository at this point in the history
Hotfix 2019.02.21
  • Loading branch information
sungkwonkudo authored Feb 21, 2019
2 parents 4d21a73 + 81ee3e0 commit c060e5b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions mliyweb/ajaxviews.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from django.http import JsonResponse, Http404
from django.shortcuts import get_object_or_404
from django.contrib.auth.models import User
from .settings import TIME_ZONE, AWS_DISCOUNT, MAX_INSTANCE_CACHE_AGE, AWS_REGION
from .settings import TIME_ZONE, AWS_DISCOUNT, MAX_INSTANCE_CACHE_AGE, AWS_REGION, DEFAULT_CHARGE_CODE
from .models import Instance, BillingData, LastRefreshed
from .prices.instances import getPrice, getInstanceData
from .refresh import InstanceRefreshThread
Expand Down Expand Up @@ -526,7 +526,7 @@ def get_data(self, context):
if inst.current_bill != None:
bill.charge_name = inst.current_bill.charge_name
else:
bill.charge_name = "ODP900"
bill.charge_name = DEFAULT_CHARGE_CODE
bill.user = User.objects.get(username=inst.userid)
bill.price = getPrice(inst.instance_type) * (1.0 - AWS_DISCOUNT)
bill.start_time = datetime.now(timezone('UTC'))
Expand Down
2 changes: 2 additions & 0 deletions mliyweb/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@

MANAGER_HOSTNAME = "127.0.0.1:8000"

DEFAULT_CHARGE_CODE = "CHANGEME"

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

AWS_S3 = 'https://s3.amazonaws.com'
Expand Down
2 changes: 1 addition & 1 deletion mliyweb/templates/mliyweb/instanceview.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ <h2 class="sub-header">Details</h2>
</table>
</div>
{% if object.state == 'stopped'%}

<input type="button" value="Start this Instance" onclick=startInst("{{ object.instance_id }}") />
{% if object.userid|lower == user|lower or user.is_staff%}
<input type="button" value="Terminate this Instance" onclick=termInst("{{ object.instance_id }}") />
{% endif %}
Expand Down

0 comments on commit c060e5b

Please sign in to comment.