This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from irhrs.organization.api.v1.tests.factory import OrganizationFactory | |
from irhrs.users.api.v1.tests.factory import UserFactory | |
from irhrs.payroll.tests.utils import PackageUtil | |
organization = OrganizationFactory() | |
user = UserFactory(_organization=organization) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ModelPermissionInterface: | |
@classmethod | |
def is_superuser(cls, user, obj=None): | |
""" | |
Return True or False | |
If True user have all permission constants | |
""" | |
raise NotImplementedError('Not impemented yet') | |
@classmethod |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ko.bindingHandlers.selectize = { | |
init: function (element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) { | |
if (!allBindingsAccessor.has('optionsText')) | |
allBindingsAccessor = inject_binding(allBindingsAccessor, 'optionsText', 'name'); | |
if (!allBindingsAccessor.has('optionsValue')) | |
allBindingsAccessor = inject_binding(allBindingsAccessor, 'optionsValue', 'id'); | |
if (typeof allBindingsAccessor.get('optionsCaption') == 'undefined') | |
allBindingsAccessor = inject_binding(allBindingsAccessor, 'optionsCaption', 'Choose...'); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
import sys | |
class Netscan: | |
def parser(self,*cmd): | |
try: | |
self.output=subprocess.check_output(cmd) | |
except: | |
print("Check your command once again.") | |
print("The required program may not exist.") | |
print("Or you are not a superuser\nThis program needs root privilege.") |