Skip to content
This repository was archived by the owner on Jan 28, 2025. It is now read-only.

Commit c060e5b

Browse files
authored
Merge pull request #6 from FINRAOS/v.2019.02.21
Hotfix 2019.02.21
2 parents 4d21a73 + 81ee3e0 commit c060e5b

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

mliyweb/ajaxviews.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from django.http import JsonResponse, Http404
2323
from django.shortcuts import get_object_or_404
2424
from django.contrib.auth.models import User
25-
from .settings import TIME_ZONE, AWS_DISCOUNT, MAX_INSTANCE_CACHE_AGE, AWS_REGION
25+
from .settings import TIME_ZONE, AWS_DISCOUNT, MAX_INSTANCE_CACHE_AGE, AWS_REGION, DEFAULT_CHARGE_CODE
2626
from .models import Instance, BillingData, LastRefreshed
2727
from .prices.instances import getPrice, getInstanceData
2828
from .refresh import InstanceRefreshThread
@@ -526,7 +526,7 @@ def get_data(self, context):
526526
if inst.current_bill != None:
527527
bill.charge_name = inst.current_bill.charge_name
528528
else:
529-
bill.charge_name = "ODP900"
529+
bill.charge_name = DEFAULT_CHARGE_CODE
530530
bill.user = User.objects.get(username=inst.userid)
531531
bill.price = getPrice(inst.instance_type) * (1.0 - AWS_DISCOUNT)
532532
bill.start_time = datetime.now(timezone('UTC'))

mliyweb/settings.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646

4747
MANAGER_HOSTNAME = "127.0.0.1:8000"
4848

49+
DEFAULT_CHARGE_CODE = "CHANGEME"
50+
4951
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
5052

5153
AWS_S3 = 'https://s3.amazonaws.com'

mliyweb/templates/mliyweb/instanceview.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ <h2 class="sub-header">Details</h2>
9494
</table>
9595
</div>
9696
{% if object.state == 'stopped'%}
97-
97+
<input type="button" value="Start this Instance" onclick=startInst("{{ object.instance_id }}") />
9898
{% if object.userid|lower == user|lower or user.is_staff%}
9999
<input type="button" value="Terminate this Instance" onclick=termInst("{{ object.instance_id }}") />
100100
{% endif %}

0 commit comments

Comments
 (0)