Clean up code
This commit is contained in:
parent
9617a1ee88
commit
0e52ab6f49
|
|
@ -26,15 +26,6 @@ import Logo from '@/components/icons/Logo';
|
||||||
@import "@/styles/_mixins.scss";
|
@import "@/styles/_mixins.scss";
|
||||||
@import "@/styles/_default-layout.scss";
|
@import "@/styles/_default-layout.scss";
|
||||||
|
|
||||||
@mixin content-block {
|
|
||||||
padding-right: $medium-spacing;
|
|
||||||
padding-left: $medium-spacing;
|
|
||||||
max-width: 800px;
|
|
||||||
min-width: 320px;
|
|
||||||
width: 100%;
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.public {
|
.public {
|
||||||
grid-template-areas: "h" "c" "f";
|
grid-template-areas: "h" "c" "f";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,10 +13,6 @@
|
||||||
import REGISTRATION_MUTATION from '@/graphql/gql/mutations/registration.gql';
|
import REGISTRATION_MUTATION from '@/graphql/gql/mutations/registration.gql';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
},
|
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
|
|
@ -165,3 +165,12 @@
|
||||||
@mixin popover-defaults() {
|
@mixin popover-defaults() {
|
||||||
bottom: $popover-default-bottom;
|
bottom: $popover-default-bottom;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@mixin content-block {
|
||||||
|
padding-right: $medium-spacing;
|
||||||
|
padding-left: $medium-spacing;
|
||||||
|
max-width: 800px;
|
||||||
|
min-width: 320px;
|
||||||
|
width: 100%;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,8 @@ def set_visible_for(block, visibility_list):
|
||||||
|
|
||||||
|
|
||||||
def is_private_api_call_allowed(user, body):
|
def is_private_api_call_allowed(user, body):
|
||||||
|
# logged in users should only be able to access all resources if they have a valid license
|
||||||
|
# logged in users without valid license have only access to logout, me & coupon mutations
|
||||||
|
|
||||||
body_unicode = body.decode('utf-8')
|
body_unicode = body.decode('utf-8')
|
||||||
|
|
||||||
|
|
@ -34,14 +36,14 @@ def is_private_api_call_allowed(user, body):
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
# logged in users should only be able to access all resources if the have a valid license
|
# logout, me and coupon resources are always allowed. Even if the user has no valid license
|
||||||
# logged in users without valid license have only access to logout, me & coupon mutations
|
|
||||||
if re.search(r"mutation\s*.*\s*logout\s*{", body_unicode) or re.search(r"query\s*.*\s*me\s*{", body_unicode)\
|
if re.search(r"mutation\s*.*\s*logout\s*{", body_unicode) or re.search(r"query\s*.*\s*me\s*{", body_unicode)\
|
||||||
or re.search(r"mutation\s*Coupon", body_unicode):
|
or re.search(r"mutation\s*Coupon", body_unicode):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
license_expiry = user.license_expiry_date
|
license_expiry = user.license_expiry_date
|
||||||
|
|
||||||
|
# all other resources are denied if the license is not valid
|
||||||
if license_expiry is None or license_expiry < timezone.now():
|
if license_expiry is None or license_expiry < timezone.now():
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue