Revision 51db2da2
b/snf-astakos-app/astakos/api/quotas.py | ||
---|---|---|
89 | 89 |
@api.api_method(http_method='GET', token_required=True, user_required=False) |
90 | 90 |
@component_from_token |
91 | 91 |
def get_pending_commissions(request): |
92 |
data = request.GET |
|
93 | 92 |
client_key = str(request.component_instance) |
94 | 93 |
|
95 | 94 |
result = qh.get_pending_commissions(clientkey=client_key) |
... | ... | |
183 | 182 |
name=name, |
184 | 183 |
force=force) |
185 | 184 |
if accept: |
186 |
done = qh.resolve_pending_commission(clientkey=clientkey, |
|
187 |
serial=serial) |
|
185 |
qh.resolve_pending_commission(clientkey=clientkey, serial=serial) |
|
188 | 186 |
|
189 | 187 |
return serial |
190 | 188 |
|
... | ... | |
255 | 253 |
serial=serial) |
256 | 254 |
status_code = 200 |
257 | 255 |
return json_response(data, status_code) |
258 |
except qh_exception.NoCommissionError as e:
|
|
256 |
except qh_exception.NoCommissionError: |
|
259 | 257 |
return HttpResponse(status=404) |
260 | 258 |
|
261 | 259 |
|
b/snf-astakos-app/astakos/im/forms.py | ||
---|---|---|
418 | 418 |
|
419 | 419 |
try: |
420 | 420 |
super(LoginForm, self).clean() |
421 |
except forms.ValidationError, e:
|
|
421 |
except forms.ValidationError: |
|
422 | 422 |
if self.user_cache is None: |
423 | 423 |
raise |
424 | 424 |
if not self.user_cache.is_active: |
... | ... | |
849 | 849 |
|
850 | 850 |
def clean(self): |
851 | 851 |
userid = self.data.get('user', None) |
852 |
policies = self.resource_policies
|
|
852 |
self.resource_policies |
|
853 | 853 |
self.user = None |
854 | 854 |
if userid: |
855 | 855 |
try: |
b/snf-astakos-app/astakos/im/functions.py | ||
---|---|---|
32 | 32 |
# or implied, of GRNET S.A. |
33 | 33 |
|
34 | 34 |
import logging |
35 |
from datetime import datetime |
|
36 | 35 |
|
37 | 36 |
from django.utils.translation import ugettext as _ |
38 | 37 |
from django.core.mail import send_mail, get_connection |
b/snf-astakos-app/astakos/im/models.py | ||
---|---|---|
31 | 31 |
# interpreted as representing official policies, either expressed |
32 | 32 |
# or implied, of GRNET S.A. |
33 | 33 |
|
34 |
import hashlib |
|
35 | 34 |
import uuid |
36 | 35 |
import logging |
37 | 36 |
import json |
38 |
import math |
|
39 | 37 |
import copy |
40 | 38 |
|
41 | 39 |
from datetime import datetime, timedelta |
... | ... | |
44 | 42 |
from random import randint |
45 | 43 |
import os |
46 | 44 |
|
47 |
from django.db import models, IntegrityError, transaction
|
|
45 |
from django.db import models, transaction |
|
48 | 46 |
from django.contrib.auth.models import User, UserManager, Group, Permission |
49 | 47 |
from django.utils.translation import ugettext as _ |
50 | 48 |
from django.db.models.signals import pre_save, post_save |
51 | 49 |
from django.contrib.contenttypes.models import ContentType |
52 | 50 |
|
53 |
from django.db.models import Q, Max
|
|
51 |
from django.db.models import Q |
|
54 | 52 |
from django.core.urlresolvers import reverse |
55 | 53 |
from django.utils.http import int_to_base36 |
56 | 54 |
from django.contrib.auth.tokens import default_token_generator |
... | ... | |
532 | 530 |
uuid_val = str(uuid.uuid4()) |
533 | 531 |
try: |
534 | 532 |
AstakosUser.objects.get(uuid=uuid_val) |
535 |
except AstakosUser.DoesNotExist, e:
|
|
533 |
except AstakosUser.DoesNotExist: |
|
536 | 534 |
self.uuid = uuid_val |
537 | 535 |
return self.uuid |
538 | 536 |
|
... | ... | |
609 | 607 |
@property |
610 | 608 |
def status_display(self): |
611 | 609 |
msg = "" |
612 |
append = None |
|
613 | 610 |
if self.is_active: |
614 | 611 |
msg = "Accepted/Active" |
615 | 612 |
if self.is_rejected: |
... | ... | |
981 | 978 |
self.info = json.loads(self.info_data) |
982 | 979 |
if not self.info: |
983 | 980 |
self.info = {} |
984 |
except Exception, e:
|
|
981 |
except Exception: |
|
985 | 982 |
self.info = {} |
986 | 983 |
|
987 | 984 |
for key, value in self.info.iteritems(): |
... | ... | |
1230 | 1227 |
username = uuid.uuid4().hex[:30] |
1231 | 1228 |
try: |
1232 | 1229 |
AstakosUser.objects.get(username=username) |
1233 |
except AstakosUser.DoesNotExist, e:
|
|
1230 |
except AstakosUser.DoesNotExist: |
|
1234 | 1231 |
self.username = username |
1235 | 1232 |
super(PendingThirdPartyUser, self).save(**kwargs) |
1236 | 1233 |
|
b/snf-astakos-app/astakos/im/project_notif.py | ||
---|---|---|
115 | 115 |
def project_termination_notify(project): |
116 | 116 |
app = project.application |
117 | 117 |
try: |
118 |
notification = build_notification(
|
|
118 |
build_notification( |
|
119 | 119 |
SENDER, |
120 | 120 |
[project.application.owner.email], |
121 | 121 |
_(messages.PROJECT_TERMINATION_SUBJECT) % app.__dict__, |
... | ... | |
128 | 128 |
|
129 | 129 |
def project_suspension_notify(project): |
130 | 130 |
try: |
131 |
notification = build_notification(
|
|
131 |
build_notification( |
|
132 | 132 |
SENDER, |
133 | 133 |
[project.application.owner.email], |
134 | 134 |
_(messages.PROJECT_SUSPENSION_SUBJECT) % project.__dict__, |
b/snf-astakos-app/astakos/im/register.py | ||
---|---|---|
53 | 53 |
raise RegisterException("Malformed resource dict.") |
54 | 54 |
|
55 | 55 |
try: |
56 |
service = Service.objects.get(name=service_origin)
|
|
56 |
Service.objects.get(name=service_origin) |
|
57 | 57 |
except Service.DoesNotExist: |
58 | 58 |
m = "There is no service %s." % service_origin |
59 | 59 |
raise RegisterException(m) |
b/snf-astakos-app/astakos/im/tables.py | ||
---|---|---|
181 | 181 |
def action_extra_context(project, table, self): |
182 | 182 |
user = table.user |
183 | 183 |
url, action, confirm, prompt = '', '', True, '' |
184 |
append_url = '' |
|
185 | 184 |
|
186 | 185 |
membership = user.get_membership(project) |
187 | 186 |
if membership is not None: |
b/snf-astakos-app/astakos/im/util.py | ||
---|---|---|
32 | 32 |
# or implied, of GRNET S.A. |
33 | 33 |
|
34 | 34 |
import logging |
35 |
import datetime |
|
36 | 35 |
import time |
37 | 36 |
import urllib |
38 | 37 |
|
39 | 38 |
from urlparse import urlparse |
40 | 39 |
from datetime import tzinfo, timedelta |
41 | 40 |
|
42 |
from django.http import HttpResponse, HttpResponseBadRequest, urlencode, \ |
|
43 |
HttpResponseRedirect |
|
41 |
from django.http import HttpResponse, HttpResponseBadRequest, urlencode |
|
44 | 42 |
from django.template import RequestContext |
45 | 43 |
from django.contrib.auth import authenticate |
46 | 44 |
from django.core.urlresolvers import reverse |
b/snf-astakos-app/astakos/im/views/im.py | ||
---|---|---|
54 | 54 |
from synnefo_branding import utils as branding |
55 | 55 |
from synnefo_branding import settings as branding_settings |
56 | 56 |
|
57 |
from synnefo.lib import join_urls |
|
58 |
|
|
59 | 57 |
import astakos.im.messages as astakos_messages |
60 | 58 |
|
61 | 59 |
from astakos.im import activation_backends |
b/snf-astakos-app/astakos/im/views/projects.py | ||
---|---|---|
48 | 48 |
from django.views.generic.list_detail import object_list, object_detail |
49 | 49 |
from django.core.exceptions import PermissionDenied |
50 | 50 |
from django.views.decorators.http import require_http_methods |
51 |
from django.db.models import Q |
|
52 | 51 |
|
53 | 52 |
from snf_django.lib.db.transaction import commit_on_success_strict |
54 | 53 |
|
... | ... | |
617 | 616 |
raise PermissionDenied(m) |
618 | 617 |
|
619 | 618 |
try: |
620 |
app = ProjectApplication.objects.get(id=application_id)
|
|
619 |
ProjectApplication.objects.get(id=application_id) |
|
621 | 620 |
except ProjectApplication.DoesNotExist: |
622 | 621 |
raise Http404 |
623 | 622 |
|
... | ... | |
650 | 649 |
raise PermissionDenied(m) |
651 | 650 |
|
652 | 651 |
try: |
653 |
app = ProjectApplication.objects.get(id=application_id)
|
|
652 |
ProjectApplication.objects.get(id=application_id) |
|
654 | 653 |
except ProjectApplication.DoesNotExist: |
655 | 654 |
raise Http404 |
656 | 655 |
|
b/snf-astakos-app/astakos/im/views/util.py | ||
---|---|---|
43 | 43 |
|
44 | 44 |
from synnefo.lib.ordereddict import OrderedDict |
45 | 45 |
|
46 |
from snf_django.lib.db.transaction import commit_on_success_strict |
|
47 |
|
|
48 | 46 |
from astakos.im import presentation |
49 | 47 |
from astakos.im.util import model_to_dict |
50 | 48 |
from astakos.im.models import Resource |
Also available in: Unified diff